Skip to content

Releases: salient-labs/toolkit

v0.21.40

14 Feb 05:30
v0.21.40
f75ce59

Choose a tag to compare

Added

  • Add ConfigurationManager and the Config facade for simple configuration file handling
  • Add Arr::get() and Arr::has()

Changed

  • Load application configuration files from <basePath>/config by default
  • Rename Facade to AbstractFacade

v0.21.39

12 Feb 23:56
v0.21.39
87e8227

Choose a tag to compare

Added

  • Add collection methods only(), onlyIn(), except(), exceptIn()
  • Add Curler::getPublicHeaders()
  • Add Get::count()

Changed

  • Move $count / $from / $to to the start of Inflect::format*() method signatures
  • In Inflect::format() and Inflect::formatWithSingularZero(), allow $count to be an array, Countable, Arrayable or Traversable, not just an int

v0.21.38

12 Feb 05:31
v0.21.38
203f9ea

Choose a tag to compare

Changed

  • Move Facade and related interfaces and traits to Salient\Core
  • Rename IReadable and IWritable to Readable and Writable and move to Salient\Core\Contract
  • Rename Readable::getReadable() to getReadableProperties()
  • Rename Writable::getWritable() to getWritableProperties()
  • Rename TReadable and TWritable to HasReadableProperties and HasWritableProperties and move to Salient\Core\Concern
  • Rename TFullyReadable and TFullyWritable to ReadsProtectedProperties and WritesProtectedProperties and move to Salient\Core\Concern

v0.21.37

07 Feb 14:50
v0.21.37
b5c063d

Choose a tag to compare

Added

  • Add ApplicationInterface::getWorkingDirectory()

Fixed

  • Fix ConsoleFormatter bug where trailing code spans do not unwrap
  • Fix inconsistent float detection in Test::isFloatValue() on PHP 7.4

v0.21.36

07 Feb 10:26
v0.21.36
7a4662e

Choose a tag to compare

Added

  • Add Str::matchCase()
  • Add Inflect::formatRange()

Changed

  • Move Convert::toValue() to Get::apparent()
  • Move Convert::toInt() to Get::integer()
  • Move Convert::linesToLists() to Str::mergeLists()
  • Move ellipsize(), expandTabs() and expandLeadingTabs() from Convert to Str
  • In Inflect::format():
    • Allow arbitrary placement of whitespace and hyphens in words
    • Allow words to be empty
    • Add # as a recognised word
    • Match the case of the placeholder

Removed

  • Remove Convert::pluralRange() in favour of Inflect::formatRange()
    • To replace a Convert::pluralRange() call with the equivalent Inflect::formatRange() call:

      <?php
      // Before:
      Convert::pluralRange($from, $to, '<noun>');
      
      // After:
      Inflect::formatRange('{{#:on:between}} {{#:<noun>}} {{#:#:and}}', $from, $to);

Security

  • Fix issue where Get::value() may inadvertently call an arbitrary function by limiting callables to Closure instances

v0.21.35

06 Feb 23:50
v0.21.35
5da66b8

Choose a tag to compare

Added

  • Add Inflect::format()
  • Add File::readCsv()

Changed

  • Move Convert::intervalToSeconds() to Date::duration()
  • Move Convert::toBool() to Get::boolean()
  • Move Convert::nounToPlural() to Inflect::plural()
  • Remove Convert::plural() in favour of Inflect::format()

Fixed

  • Fix issue where Date::duration() silently discards weeks in durations like 'P1W2D' on PHP 7.4

v0.21.34

06 Feb 13:58
v0.21.34
b0a4391

Choose a tag to compare

Added

  • Add ContainerInterface::addContextualBinding()
  • Add ContainerInterface::hasProvider()
  • Add HasBindings interface
  • Add Get::value()

Changed

  • Rename IServiceSingleton to SingletonInterface and do not extend IService
  • Split IService into HasServices and HasContextualBindings
  • Rename ReceivesContainer to ContainerAwareInterface and change return type of setContainer() to void
  • Rename ReceivesService to ServiceAwareInterface and change return type of setService() to void
  • Rename container service methods to provider equivalents
  • In ContainerInterface / Container:
    • Return void from setGlobalContainer()
    • Throw ContainerUnusableArgumentsException when arguments are given but cannot be passed to a constructor
    • Remove $shared parameter from bind(), singleton(), etc., and make $args parameter non-nullable
    • Make provider() parameter $exceptServices non-nullable
    • In providers(), require service providers to be mapped (they can be mapped to themselves if otherwise unbound), and allow any class to be a service provider, not just HasServices (formerly IService) implementors
  • Use ServiceLifetime as a standard enumeration, not a bitmask
  • Rename ContainerNotLocatedException to ContainerNotFoundException
  • Rename GlobalContainerSetEvent to BeforeGlobalContainerSetEvent
  • Move ApplicationInterface::getProgramName() to CliApplicationInterface
  • Remove App facade
  • Rename DI facade to App
  • Replace underlying instance of App with global container on BeforeGlobalContainerSetEvent
  • Always unload facades in ErrorHandler and SqliteStore
  • Move ContainerInterface and ApplicationInterface to Lkrms\Container
  • Finalise Container API for v1.0

Removed

  • Remove unused ContainerInterface::getContextStack()
  • Remove unused ServiceSingletonInterface and ServiceLifetime::SERVICE_SINGLETON and their respective implementations
  • Remove unused TService trait

Fixed

  • Fix issue where Container binds itself to FluentInterface
  • Fix issue where Container::has() returns false when it has a shared instance with the given identifier
  • Fix issue where conditional bindings (e.g. bindIf()) are registered with containers that already have a shared instance with the given identifier
  • Fix issue where BeforeGlobalContainerSetEvent is not dispatched when a container is created via Container::getGlobalContainer()
  • Fix issue where the global container is unbound from itself after it is unloaded from a facade

v0.21.33

30 Jan 06:14
v0.21.33
4216e47

Choose a tag to compare

Changed

  • Rename IContainer to ContainerInterface and move to Lkrms\Container\Contract
  • Rename IApplication to ApplicationInterface and move to Lkrms\Container\Contract
  • Rename Cli interfaces:
    • ICliApplication -> CliApplicationInterface
    • ICliCommand -> CliCommandInterface
    • ICliCommandNode -> CliCommandNodeInterface
  • Move CliHelpStyle from Lkrms\Cli\Support to Lkrms\Cli, removing unnecessary Lkrms\Cli\Support namespace
  • Finalise v1.0 Cli API

Fixed

  • Cli: fix issue where IsBound may be true for unbound options

v0.21.32

29 Jan 03:24
v0.21.32
9d30780

Choose a tag to compare

Added

  • Add Application::setWorkingDirectory()
  • Add File::chdir()

Fixed

  • Throw an exception when Application::restoreWorkingDirectory() fails

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