Skip to content

Releases: salient-labs/toolkit

v0.21.31

29 Jan 02:00
v0.21.31
af32810

Choose a tag to compare

Added

  • Add Application::restoreWorkingDirectory()
  • Add $inSchema parameter to CliOption::__construct()

Changed

  • In CliCommand::getOptionValues(), add optional $unexpand parameter, and suppress value-optional options not given on the command line

Fixed

  • Fix CliCommand::applyOptionValues() issue where value-optional options are expanded on export after they are applied

v0.21.30

28 Jan 05:48
v0.21.30
774eee4

Choose a tag to compare

Added

  • Add IContainer::hasInstance()
  • Add FacadeInterface::swap()
  • Add HasFacade and UnloadsFacades traits and adopt where possible
  • Allow Facade::getService() to return a service/alias list
  • Add optional alias option to lk-util generate facade command
  • Add ResolvesServiceLists trait and use in Facade to normalise service lists
  • Add Get::fqcn()

Changed

  • Rename IFacade to FacadeInterface
  • Replace forwarded constructor parameters in FacadeInterface::load() with an optional $instance parameter, and change return type to void
  • Rename ReceivesFacade to FacadeAwareInterface
  • Remove FacadeAwareInterface method setFacade() in favour of immutable-friendly withFacade() and withoutFacade() methods
  • Rename Facade method getServiceName() to getService() for consistency with other classes
  • In Facade::unload(), check the global container resolves the facade's service name to the underlying instance before unbinding it
  • In Container::has(), only return true if the container has an explicit binding for $id
  • Add optional $classes parameter to Get::code() for output like <class>::class instead of "<class>"
  • In Get::code(), convert float values with an exponent to lowercase
  • Decouple ConsoleWriter state from the ConsoleWriter class to take advantage of the new facade API

Fixed

  • Work around "Private methods cannot be final as they are never overridden by other classes" bug in PHP 8.3.2 by replacing IsCatalog trait with equivalent class Catalog
  • Fix Container issue where shared instances are discarded when created via getAs()
  • Fix Introspector issue where an exception is thrown if a constructor has a variadic parameter
  • Fix issue where Facade::unloadAll() fails with "No listener with that ID"

v0.21.29

24 Jan 12:16
v0.21.29
bf55064

Choose a tag to compare

Added

  • Add counters to metrics collected by Timekeeper and its Profile facade
  • Add Arr::keyOf()

Changed

  • Rename Timekeeper to more accurate MetricCollector
  • Rename "timer types" to "metric groups"
  • Rename MetricCollector/Profile methods:
    • pushTimers() => push()
    • popTimers() => pop()
  • Rename IApplication::reportTimers() to reportMetrics()
  • Report counters and timers subsequently in Application output
  • Improve Pcre::replaceCallback() and Pcre::replaceCallbackArray() annotations for PHPStan users
  • Move utility methods:
    • Convert::coalesce() => Get::coalesce()
    • Convert::sizeToBytes() => Get::bytes()
    • Convert::valuesToCode() => Get::code()
    • Sys::getCwd() => File::cwd()

Fixed

  • Fix Application issues where:
    • All metrics output is bold
    • Numeric timer names are lost if the number of timers/counters reported is limited
  • Fix issue where Get::bytes() is less forgiving than PHP's ini parser
  • Fix issue where min and max in integer ranges (e.g. int<1,max>) are treated as class names

v0.21.28

20 Jan 17:44
v0.21.28
960cc80

Choose a tag to compare

Added

  • Add Unloadable interface
  • Add ConsoleTargetInterface::close()
  • Add ConsoleTargetStreamInterface::reopen()
  • Add ConsoleInvalidTargetException
  • Add Console::deregisterAllTargets() and call it when the Console facade's underlying ConsoleWriter is unloaded

Changed

  • If a facade's underlying instance implements Unloadable, call its unload() method before removing it from the facade
  • In Console::deregisterTarget(), call close() on deregistered targets
  • In File::same(), return earlier if filenames are identical

Fixed

  • Fix issue where the first underlying instance loaded by Facade is never completely unloaded because its container event listener is never removed
  • Fix issue where Facade::unloadAll() bypasses deregistrations applied in Facade::unload()

v0.21.27

20 Jan 07:10
v0.21.27
e19d5ff

Choose a tag to compare

Changed

  • Add optional $directory and $prefix arguments to File::createTempDir()
  • Add optional $forgetArguments parameter to CliCommand::applyOptionValues()

v0.21.26

20 Jan 04:24
v0.21.26
a8ec245

Choose a tag to compare

Added

  • Add CliCommand::optionHasArgument()
  • Add ICliApplication::getLastCommand() and implement in CliApplication

Changed

  • Make CliCommand::getRuns() public

Removed

  • Remove unused Assert::isMatch()

v0.21.25

20 Jan 03:58
v0.21.25
f7d2d86

Choose a tag to compare

Added

  • Add Str::eolToNative() and Str::eolFromNative()

Changed

  • In Str::setEol(), normalise strings with multiple end-of-line sequences, reverting change made in v0.21.19
  • Replace multi-line strings in Console and Cli to ensure the only end-of-line sequence used internally is "\n"
  • Don't enable PCRE's Unicode flag unnecessarily in ConsoleFormatter

v0.21.24

19 Jan 06:43
v0.21.24
ee820cd

Choose a tag to compare

Fixed

  • Fix issue where Cli options cannot be applied to cloned commands

v0.21.23

19 Jan 04:53
v0.21.23
e7f85be

Choose a tag to compare

Added

  • Add Get::copy(), a deep copy implementation similar to myclabs/deep-copy
  • Add Reflect::getAllProperties()
  • Add UncloneableObjectException
  • Add a UnitEnum stub for PHP <8.1

Changed

  • Return without declaring stubs that have already been declared

Fixed

  • Fix issue where Cli options are still bound to their original variables / properties after a command is cloned (caveat: commands must be cloned with Get::copy())

v0.21.22

18 Jan 00:45
v0.21.22
52d86a0

Choose a tag to compare

Changed

  • Use native line endings in Json::prettyPrint() and elsewhere previously overlooked

Fixed

  • Cli: fix regression where terse synopses are double-escaped