Skip to content

v0.21.4

Choose a tag to compare

@lkrms lkrms released this 17 Nov 04:01
· 1378 commits to main since this release
v0.21.4
b0823f6

Added

  • lk-util: add first cut of generate tests command

  • Add Cache::asOfNow() to mitigate race conditions arising from expiry of items between subsequent calls to Cache::has() and Cache::get()

  • Add Cache::getInstanceOf(), Cache::getItemCount() and Cache::getAllKeys()

  • Implement PSR-14

    • EventDispatcher:
      • Implement EventDispatcherInterface and ListenerProviderInterface
      • Optionally compose a separate ListenerProviderInterface
      • Rework dispatch() and listener signatures for PSR-14 compliance
    • Add Reflect::getFirstCallbackParameterClassNames() (required for event listener autowiring)
    • Add ServiceEvent and StoppableServiceEvent
  • Add methods:

    • Arr::listOfArrayKey()
    • Arr::listOfInt()
    • Arr::listOfString()
    • Arr::trimAndImplode()
    • Assert::instanceOf()

Changed

  • In Arr::trim(), remove empty strings by default

  • In Cache::set() and Cache::maybeGet(), accept DateTimeInterface expiration times

  • Rename InvalidRuntimeConfigurationException to IncompatibleRuntimeEnvironmentException

  • Add HasName interface and move HasDescription::name() to HasName

  • Remove nullability from return types of HasName::name() and HasDescription::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 to Has* to simplify grammar:

    • ReturnsContainer -> HasContainer
    • ReturnsDescription -> HasDescription
    • ReturnsEnvironment -> HasEnvironment
    • ReturnsIdentifier -> HasIdentifier
    • ReturnsProvider -> HasProvider
    • ReturnsProviderContext -> HasProviderContext
    • ReturnsService -> HasService
  • Introspector::getGetNameClosure():

    • Remove nullability from closure return type
    • Do not fall back to description when there are no name properties
    • Return "#$id" when falling back to id
    • 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()