Commit 890bb76f authored by alexpott's avatar alexpott
Browse files

Issue #2845666 by dpi, ritzz, dawehner: *TempStore's missing @throws documentation

parent 0a7b3e6d
......@@ -112,6 +112,9 @@ public function get($key) {
* The key of the data to store.
* @param mixed $value
* The data to store.
*
* @throws \Drupal\user\TempStoreException
* Thrown when a lock for the backend storage could not be acquired.
*/
public function set($key, $value) {
$key = $this->createkey($key);
......@@ -161,6 +164,9 @@ public function getMetadata($key) {
* @return bool
* TRUE if the object was deleted or does not exist, FALSE if it exists but
* is not owned by $this->owner.
*
* @throws \Drupal\user\TempStoreException
* Thrown when a lock for the backend storage could not be acquired.
*/
public function delete($key) {
$key = $this->createkey($key);
......
......@@ -164,6 +164,9 @@ public function setIfNotExists($key, $value) {
* @return bool
* TRUE if the data was set, or FALSE if it already exists and is not owned
* by $this->user.
*
* @throws \Drupal\user\TempStoreException
* Thrown when a lock for the backend storage could not be acquired.
*/
public function setIfOwner($key, $value) {
if ($this->setIfNotExists($key, $value)) {
......@@ -185,6 +188,9 @@ public function setIfOwner($key, $value) {
* The key of the data to store.
* @param mixed $value
* The data to store.
*
* @throws \Drupal\user\TempStoreException
* Thrown when a lock for the backend storage could not be acquired.
*/
public function set($key, $value) {
if (!$this->lockBackend->acquire($key)) {
......@@ -228,6 +234,9 @@ public function getMetadata($key) {
*
* @param string $key
* The key of the data to delete.
*
* @throws \Drupal\user\TempStoreException
* Thrown when a lock for the backend storage could not be acquired.
*/
public function delete($key) {
if (!$this->lockBackend->acquire($key)) {
......@@ -251,6 +260,9 @@ public function delete($key) {
* @return bool
* TRUE if the object was deleted or does not exist, FALSE if it exists but
* is not owned by $this->owner.
*
* @throws \Drupal\user\TempStoreException
* Thrown when a lock for the backend storage could not be acquired.
*/
public function deleteIfOwner($key) {
if (!$object = $this->storage->get($key)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment