Releases: salient-labs/toolkit
Releases · salient-labs/toolkit
v0.21.31
Added
- Add
Application::restoreWorkingDirectory() - Add
$inSchemaparameter toCliOption::__construct()
Changed
- In
CliCommand::getOptionValues(), add optional$unexpandparameter, 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
Added
- Add
IContainer::hasInstance() - Add
FacadeInterface::swap() - Add
HasFacadeandUnloadsFacadestraits and adopt where possible - Allow
Facade::getService()to return a service/alias list - Add optional
aliasoption tolk-util generate facadecommand - Add
ResolvesServiceListstrait and use inFacadeto normalise service lists - Add
Get::fqcn()
Changed
- Rename
IFacadetoFacadeInterface - Replace forwarded constructor parameters in
FacadeInterface::load()with an optional$instanceparameter, and change return type tovoid - Rename
ReceivesFacadetoFacadeAwareInterface - Remove
FacadeAwareInterfacemethodsetFacade()in favour of immutable-friendlywithFacade()andwithoutFacade()methods - Rename
FacademethodgetServiceName()togetService()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 returntrueif the container has an explicit binding for$id - Add optional
$classesparameter toGet::code()for output like<class>::classinstead of"<class>" - In
Get::code(), convertfloatvalues with an exponent to lowercase - Decouple
ConsoleWriterstate from theConsoleWriterclass 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
IsCatalogtrait with equivalent classCatalog - Fix
Containerissue where shared instances are discarded when created viagetAs() - Fix
Introspectorissue 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
Added
- Add counters to metrics collected by
Timekeeperand itsProfilefacade - Add
Arr::keyOf()
Changed
- Rename
Timekeeperto more accurateMetricCollector - Rename "timer types" to "metric groups"
- Rename
MetricCollector/Profilemethods:pushTimers()=>push()popTimers()=>pop()
- Rename
IApplication::reportTimers()toreportMetrics() - Report counters and timers subsequently in
Applicationoutput - Improve
Pcre::replaceCallback()andPcre::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
Applicationissues 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
minandmaxin integer ranges (e.g.int<1,max>) are treated as class names
v0.21.28
Added
- Add
Unloadableinterface - Add
ConsoleTargetInterface::close() - Add
ConsoleTargetStreamInterface::reopen() - Add
ConsoleInvalidTargetException - Add
Console::deregisterAllTargets()and call it when theConsolefacade's underlyingConsoleWriteris unloaded
Changed
- If a facade's underlying instance implements
Unloadable, call itsunload()method before removing it from the facade - In
Console::deregisterTarget(), callclose()on deregistered targets - In
File::same(), return earlier if filenames are identical
Fixed
- Fix issue where the first underlying instance loaded by
Facadeis never completely unloaded because its container event listener is never removed - Fix issue where
Facade::unloadAll()bypasses deregistrations applied inFacade::unload()
v0.21.27
v0.21.26
v0.21.25
Added
- Add
Str::eolToNative()andStr::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
ConsoleandClito ensure the only end-of-line sequence used internally is "\n" - Don't enable PCRE's Unicode flag unnecessarily in
ConsoleFormatter
v0.21.24
v0.21.23
Added
- Add
Get::copy(), a deep copy implementation similar tomyclabs/deep-copy - Add
Reflect::getAllProperties() - Add
UncloneableObjectException - Add a
UnitEnumstub 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())