v0.21.4
Added
-
lk-util: add first cut ofgenerate testscommand -
Add
Cache::asOfNow()to mitigate race conditions arising from expiry of items between subsequent calls toCache::has()andCache::get() -
Add
Cache::getInstanceOf(),Cache::getItemCount()andCache::getAllKeys() -
Implement PSR-14
EventDispatcher:- Implement
EventDispatcherInterfaceandListenerProviderInterface - Optionally compose a separate
ListenerProviderInterface - Rework
dispatch()and listener signatures for PSR-14 compliance
- Implement
- Add
Reflect::getFirstCallbackParameterClassNames()(required for event listener autowiring) - Add
ServiceEventandStoppableServiceEvent
-
Add methods:
Arr::listOfArrayKey()Arr::listOfInt()Arr::listOfString()Arr::trimAndImplode()Assert::instanceOf()
Changed
-
In
Arr::trim(), remove empty strings by default -
In
Cache::set()andCache::maybeGet(), acceptDateTimeInterfaceexpiration times -
Rename
InvalidRuntimeConfigurationExceptiontoIncompatibleRuntimeEnvironmentException -
Add
HasNameinterface and moveHasDescription::name()toHasName -
Remove nullability from return types of
HasName::name()andHasDescription::description() -
Move and/or refactor methods, deprecating the original:
Convert::sparseToString()->Arr::implodeNotEmpty()Convert::flatten()->Arr::unwrap()Convert::toArray()->Arr::wrap()Convert::toList()->Arr::listWrap()Convert::toUniqueList()->Arr::unique()Convert::toDateTimeImmutable()->Date::immutable()Test::isListArray()->Arr::isList()Test::isIndexedArray()->Arr::isIndexed()Test::isArrayOfArrayKey()->Arr::ofArrayKey()Test::isArrayOfInt()->Arr::ofInt()Test::isArrayOfString()->Arr::ofString()
-
Rename methods:
Arr::notNull()->whereNotNull()Arr::notEmpty()->whereNotEmpty()Arr::implodeNotEmpty()->implode()
-
Rename
Returns*interfaces toHas*to simplify grammar:ReturnsContainer->HasContainerReturnsDescription->HasDescriptionReturnsEnvironment->HasEnvironmentReturnsIdentifier->HasIdentifierReturnsProvider->HasProviderReturnsProviderContext->HasProviderContextReturnsService->HasService
-
Introspector::getGetNameClosure():- Remove nullability from closure return type
- Do not fall back to
descriptionwhen there are no name properties - Return
"#$id"when falling back toid - Fix issue where closures may return types other than
string - Fix issue where closures fail to resolve first and last name pairs when normalisers other than snake_case are used
Removed
- Remove unused methods:
Convert::toUnique()Convert::columnsToUniqueList()Test::isAssociativeArray()Test::isArrayOfValue()Reflect::getAllTraits()
Fixed
- Fix builtin type handling in
Reflect::getTypeDeclaration()