Just a re-release locking the interface in place. First final release!
Changes
- Add static analysis using psalm.
Exception
has been renamed toGetSetException
for clarity.getMultiple()
has been removed from all collections.- When removing a non-existing key, since the end result is reached, no exception will be thrown anymore.
Changes
- Dropped support for php7, php8 only from now on.
Changes
- Added
getMultiple(string ...$keys): array
so you can request multiple keys in one go. The default value if not found is alwaysnull
.
// Example of getMultiple:
[$title, $content] = $postCollection->getMultiple('title', 'content');
Changes
get()
returnsnull
or a custom default value when a key doesn't exist.remove()
throws an exception.getAndRemove()
also threw an exception, but the primary goal is to get the value. This behavior has been flipped. NowgetAndRemove()
will returnnull
/default if the key doesn't exist and not throw anymore.
No changes, code style fix.
Changes
- Add
string
type-hinting to$key
forget()
andgetAndRemove()
, in line with the rest. - Add
$default = null
parameter toget()
, so that the scenarios of 'not set' and 'set butnull
' can be distinguished between.
Changes
- First release.