Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Cast return value of removeItem() to boolean in delete()
Browse files Browse the repository at this point in the history
In cases where an exception handler is in place, it's possible for a
null/void to be returned instead of a boolean. Casting it to boolean
will ensure a boolean false is returned, which is what we want.
  • Loading branch information
weierophinney committed Apr 23, 2018
1 parent 7792e51 commit 10eb0a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Psr/SimpleCache/SimpleCacheDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function delete($key)
}

try {
return $this->storage->removeItem($key);
return (bool) $this->storage->removeItem($key);
} catch (Throwable $e) {
return false;
} catch (Exception $e) {
Expand Down

0 comments on commit 10eb0a3

Please sign in to comment.