Skip to content

Latest commit

 

History

History
326 lines (186 loc) · 11.7 KB

CHANGELOG.md

File metadata and controls

326 lines (186 loc) · 11.7 KB

CHANGELOG

Unreleased

  • (ADD) $container->lazyLazy() to create a callable from a LazyInterface that is directly invokable.
  • (CHG) Fix lazyGet not resolving the same service.

5.0.0-alpha.1

  • (ADD) Inject via attributes
  • (ADD) Configure the container via attributes using the AttributeConfigInterface
  • (ADD) Directories scanner for classes and annotations
  • (ADD) Dependency requirement of composer/class-map-generator when using the scanner
  • (ADD) Compile the container, making it fully ready to instantiate instances and services
  • (ADD) ContainerCompileInterface to allow config classes to hook into the compilation process
  • (ADD) Support for PHP 8.2 and 8.3
  • (ADD) Support for PHPUnit 10
  • (ADD) PHPStan analysis
  • (CHG) Dropped support psr/container 1.x
  • (CHG) Dropped PHP 7
  • (CHG) Dropped PHPUnit 8
  • (CHG) Remove roave/security-advisories (include composer now)
  • (CHG) Container constructor now requires a Resolver
  • (CHG) Container constructor does not require a InjectionFactory anymore
  • (CHG) LazyInterface now expects a Resolver when __invoke gets called
  • (CHG) Resolver now holds the service instances
  • (CHG) Dropped PHPUnit polyfills

4.2.1

  • (CHG) Allow both v1 and v2 of psr/container

4.2.0

  • (CHG) Upgrade to PHP 7.4+ and PHP 8.0
  • (CHG) Upgrade psr/container to ^2.0
  • (CHG) Upgrade phpunit to ^9.5
  • (CHG) Resolver now checks if class exists before calling get_parent_class
  • (CHG) Wrapped ReflectionClass calls in a try catch
  • (CHG) Removed acclimate/container.
  • (ADD) Replace acclimate/container with CompositeContainer

4.1.0

  • (ADD) Support 7.4

4.0.0

  • (CHG) Upgrade to PHP 7.2+ only, strict types enabled

  • (CHG) Dropped HHVM support

  • (CHG) Signatures of methods in ContainerConfigInterface changed.

  • (CHG) LazyRequire and LazyInclude do not accept another lazy

  • (CHG) Removed container interop dependency

  • (CHG) Removed unsupported community channels

  • (ADD) Contextual parameters

  • (ADD) Producer

3.4.0

  • (CHG) LazyArray now extends ArrayObject. PR #151.

3.3.0

  • (DOC) Update documentation. PR #140.

  • (CHG) Rearranging code to achieve full test coverage with the existing test suite. PR #141.

  • (ADD) ResolutionHelper. PR #143. Fixes #133.

  • (Add) ConfigCollection. PR #146.

  • (CHG) Update Reflector.php for PHP 7.2 compatibility. PR #148.

  • (CHG) Travis CI changes. PR #152.

  • (CHG) Removed CHANGES.md. Added CHANGELOG.md

3.2.0

This release adds three new features.

  • (ADD) LazyInclude and LazyRequire can now recieve a LazyValue as a filename, so that the filename is not resolved until the include/require is invoked.

  • (ADD) Allow direct use of lazies in Lazy; cf PR #128.

  • (ADD) Add a new LazyCallable type for injecting callable services; cf. PR #129.

  • (CHG) LazyValue now resolves lazies itself; cf. PR #137.

  • (ADD) Add a new LazyArray type for injecting arrays of lazy-resolved values; cf PR #138.

There are also carious documentation improvements, and the package now provides (via Composer) the virtual package container-interop-implementation.

3.1.0

This release has one documentation addition, and one feature addition.

  • Added documentation for upgrading/migrating from 2.x to 3.x

  • In ContainerBuilder::newConfiguredInstance(), added the ability to pass a ContainerConfig object instance as a config specification.

3.0.0

This is the second beta release of this library, and likely the last before a stable release (barring unexpected feature changes and bugfixes).

  • (BRK) Container methods newInstance() and get() now lock the Container automatically. (See note below.)

  • (CHG) $di->params now allows null as a parameter value.

  • (ADD) ContainerConfigInterface

  • (ADD) Better exception messages.

  • (DOC) Add and update documentation.


Regarding auto-locking of the Container after newInstance() and get():

This prevents errors from premature unification of params/setters/values/etc. in the Resolver. As a result, do not use Container newInstance() or get() before you are finished calling $params, $setters, $values, set(), or other methods that modify the Container. Use the lazy*() equivalents to avoid auto-locking the Container.

3.0.0-beta2

  • BREAK: Rename Aura\Di\_Config\AbstractContinerTest to Aura\Di\AbstractContainerConfigTest.

  • BREAK: The ContainerBuilder no longer accepts pre-built services, only config class names.

  • BREAK: Remove the Aura\Di\Exception\ReflectionFailure exception, throw the native \ReflectionException instead.

  • BREAK: Previously, the AutoResolver would supply an empty array for array typehints, and null for non-typehinted parameters. It no longer does so; it only attempts to auto-resolve class/interface typehints.

  • CHANGE: Add .gitattributes file for export-ignore values.

  • CHANGE: Allow PHP 5.5 as the minimum version.

  • ADD: Allow constructor params to be specified using position number; this is in addition to specifying by $param name. Positional params take precendence over named params, to be consistent pre-existing behavior regarding merged parameters.

  • DOCS: Update documentation, add bookdown files.

3.0.0-beta1

  • BREAK: Rename Aura\Di\_Config\AbstractContinerTest to Aura\Di\AbstractContainerConfigTest.

  • BREAK: The ContainerBuilder no longer accepts pre-built services, only config class names.

  • BREAK: Remove the Aura\Di\Exception\ReflectionFailure exception, throw the native \ReflectionException instead.

  • BREAK: Previously, the AutoResolver would supply an empty array for array typehints, and null for non-typehinted parameters. It no longer does so; it only attempts to auto-resolve class/interface typehints.

  • CHANGE: Add .gitattributes file for export-ignore values.

  • CHANGE: Allow PHP 5.5 as the minimum version.

  • ADD: Allow constructor params to be specified using position number; this is in addition to specifying by $param name. Positional params take precendence over named params, to be consistent pre-existing behavior regarding merged parameters.

  • DOCS: Update documentation, add bookdown files.

3.0.0-alpha1

This is releases moves the AbstractContainerTest to is proper location. Sorry for making two releases in a row so quickly.

2.2.4

  • Fixes #91 property-read designation causes PHPStorm to have syntax error. Changed @property-read to @property so they will still be auto-completed by IDE. Thank you David Stockton, Brandon Savage.
  • Fix the doc comments.

2.2.3

This release provides a better message for Exception\ReflectionFailure, via issue #73.

2.2.2

This is releases moves the AbstractContainerTest to is proper location. Sorry for making two releases in a row so quickly.

2.2.1

This release restructures the testing and support files, particularly Composer. Note the changes in how tests are run in the new README.md.

2.2.0

This release has a couple of feature improvements: traits in ancestor classes and in ancestor traits are now honored, and the DI container can now be serialized and unserialized (unless it contains closures).

  • ADD: The Factory now gets all traits of ancestor classes & ancestor traits.

  • NEW: Class Aura\Di\Reflection decorates ReflectionClass to permit serialization of the DI Container for caching.

  • FIX: The ContainerBuilder now call setAutoResolve() early, rather than late.

  • FIX: If the class being factories has no __construct() method, instantiate without constructor.

  • DOC: Update documentation and support files.

2.1.0

This release incorporates functionality to optionally disable auto-resolution. By default it remains enabled, but this default may change in a future version.

  • Add Container::setAutoResolve(), Factory::setAutoResolve(), etc. to allow disabling of auto-resolution

  • When auto-resolution is disabled, Factory::newInstance() now throws Exception\MissingParam when a constructor param has not been defined

  • ContainerBuilder::newInstance() now takes a third param to enable/disable auto-resolution

  • AbstractContainerTest now allows you to enable/disable auto-resolve for the tests via a new getAutoResolve() method

2.0.0

  • DOC: In README, note that magic-call setters will not work.

  • BRK: Related to testing under PHP 5.3, remove the ContainerAssertionsTrait. The trait is not 5.3 compatible, so it has to go. Instead, you can extend the Aura\Di_Config\AbstractContainerTest in tests/container/src/ and override the provideGet() and provideNewInstance() methods. Sorry for the hassle.

2.0.0-beta2

Second beta release.

  • REF: Extract object creation from Container into Factory

  • DOC: Complete README rewrite, update docblocks

  • ADD: The Factory now supports setters from traits.

  • ADD: LazyValue functionality.

  • ADD: Auto-resolution of typehinted constructor parameters, and of array typehints with no default value, along with directed auto-resolution.

  • ADD: ContainerAssertionsTrait so that outehr packages can more easily test their container config classes.

2.0.0-beta1

Initial 2.0 beta release.

  • Container v1 configurations should still work, with one exception: the lazyCall() method has been removed in favor of just lazy(). Replace lazyCall() with lazy() and all should be well.

  • Now compatible with PHP 5.3.

  • Uses PSR-4 autoloading instead of PSR-0.

  • The package now has a series of Lazy classes to represent different types of lazy behaviors, instead of using anonymous functions.

  • No more cloning of Container objects; that was a holdover from when we had sub-containers very early in v1 and never really used.

  • Removed Forge and placed functionality into Container.

  • Removed the old Config object; $params and $setter are now properties on the Container.

  • No more top-level '*' config element.

  • Renamed Container getServices() to getInstances().

  • Renamed Container getDefs() to getServices().

  • Added ContainerBuilder and new Config object for two-stage configuration.

  • Now honors $setter values on interface configuration; that is, you can configure a setter on an interface, and classes implementing that interface will honor that value unless overridden by a class parent.

Thanks to HariKT, Damien Patou, Jesse Donat, jvb, and Grummfy for their contributions leading to this release!

1.1.2

Hygeine release.

  • Add test for #38 -- looks OK
  • Merge pull request #32 from harikt/patch-dev
  • Add a benching script

1.1.1

  • [CHG] Config now throws Exception\SetterMethodNotFound when a setter method is configured but does not exist on the class

  • [CHG] Container::set() now throws Exception\ServiceNotObject when the service being set is not an object.

  • [CHG] Config now throws Exception\ReflectionFailure when reflection fails.

  • [DOC] Typo fixes and clarifications; add PHP 5.5 to Travis build

  • [DEL] Remove unused exceptions ContainerExists and ContainerNotFound

1.1.0

  • [ADD] Container::lazyInclude() and lazyRequire() to lazily include or require files

  • [ADD] Container::lazyCall() to lazily make a call to any callable, with sequential (not named) parameters, just like with call_user_func()

  • [ADD] Container::newFactory() method

  • [NEW] Factory class, to create new class instances using the Forge

  • [REF] Refactor Forge::newInstance() extract method mergeParams(), and make allowance for positional override params (these take precedence over named override params)

1.0.1

(This change log includes notes from in release 1.0.0, which failed to specify them.)

  • [ADD] Config now honors setters on trait methods.

  • [ADD] Method Container::lazy() for general-purpose lazy params (i.e., any param can now be lazy, not just services and class instantiations.)

Special thanks to Yuya Takeyama for working on the documentation, along with Akihito Koriyama and Michal Amerek.

1.0.0

  • The Forge::newInstance() method now has a third param, $setters, to allow passing of setter injection values.