aura/di
Aura.Di is a PSR-11 dependency injection container for PHP 8+, supporting serializable containers, constructor and setter injection, interface/trait awareness, and configuration inheritance. Lightweight, standards-friendly, and flexible for complex apps.
Missing scanning root package.
Classes that generate an error should not be part of the class map at all
Allow to override class iterator inside ClassScannerConfig. This might be useful to filter classes and/or to apply a certain order in the class iterator.
New major Aura.Di version with many new features, with special attention for configuring the container using native PHP attributes. If you are going to upgrade, you might have a look at the migrating docs.
For a specific list of changes, see the CHANGELOG.
#[Blueprint] and #[BlueprintNamespace] to mark classes and namespaces to be compiled into blueprints.#[AttributeConfigFor] attribute to indicate scanner which attribute is configured by the annotated class.#[CompileNamespace] attribute to indicate scanner which namespace should have compiled blueprints.bin/auradi executable with scan command.lazyGet not resolving the same service.#[Service], #[Instance] and #[Value] must have Attribute::TARGET_PROPERTY to allow constructor promotion.(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
(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
(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
To remove 7.x warning, replace list() ... each() with foreach.
Also update the Travis configuration.
Thanks to @dstepe for these changes!
(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
This release adds these new features.
There are also various documentation improvements, and the package now provides (via Composer) the virtual package container-interop-implementation.
This release has one documentation addition, and one feature addition.
This is the first 3.x stable release.
This is the second beta release of this library, and likely the last before a stable release (barring unexpected feature changes and bugfixes).
newInstance() and get() now lock the Container automatically. (See note below.)$di->params now allows null as a parameter value.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.
Aura\Di\_Config\AbstractContinerTest to Aura\Di\AbstractContainerConfigTest.Aura\Di\Exception\ReflectionFailure exception, throw the native \ReflectionException instead.This release provides a better message for Exception\ReflectionFailure, via issue #73.
First 3.x alpha release.
This is releases moves the AbstractContainerTest to is proper location. Sorry for making two releases in a row so quickly.
How can I help you explore Laravel packages today?