ghostwriter/container
Provides an extensible Dependency Injection Service Container for Automated Object Composition, Interception, and Lifetime Management.
7.0.2
7.2M downloads/mo
#1160 most downloaded on Packagist
ghostwriter/container
What this package is like to depend on
Last release 2 months ago
27 May 2026
Release timing varies
gaps range from 8 days to 8 months
Some releases are documented
notes for 14 of 41 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
41 releases · first in 2022
7 releases in the last 12 months
see the full history below
Release timeline
41 releases · Apr 2022 to May 2026Releases
latest 41-
7.0.227 May 2026 -
7.0.122 Apr 2026 -
7.0.020 Apr 2026Release notes
Open source →Removed
- Definition-based registration: Removed
DefinitionInterfaceand all related Composerextradefinition classes. - Deprecated APIs: Removed the
define()method fromContainerand all definition-based registration logic. - Reflection/parameter caches: Removed all internal reflection and parameter caches from the container.
Changed
- Composer Provider Renaming:
- Renamed
ComposerDefinitionProviderInterfacetoComposerServiceProviderInterface. - Renamed
ComposerDefinitionProvidertoComposerServiceProvider.
- Renamed
- Container internals:
- Simplified callable and service normalization logic.
- Improved circular dependency detection and service-not-found exception handling.
- Updated container to use only service/provider-based registration.
- Composer provider:
- Refactored internals for installed package discovery.
- Added
missingComposerFileshelper for improved Composer integration.
- Updated all tests to reflect the new API and the removal of definition-based behavior.
Full Changelog: 6.1.1...7.0.0
Release notes
Open source →Removed
- Definition-based registration: Removed
DefinitionInterfaceand all related Composerextra/containerdefinition classes. - Deprecated APIs: Removed the
define()method fromContainerand all definition-based registration logic. - Reflection/parameter caches: Removed all internal reflection and parameter caches from the container.
Changed
- Composer Provider Renaming:
- Renamed
ComposerDefinitionProviderInterfacetoComposerServiceProviderInterface. - Renamed
ComposerDefinitionProvidertoComposerServiceProvider.
- Renamed
- Container internals:
- Simplified callable and service normalization logic.
- Improved circular dependency detection and service-not-found exception handling.
- Updated container to use only service/provider-based registration.
- Composer provider:
- Refactored internals for installed package discovery.
- Added
missingComposerFileshelper for improved Composer integration. - Updated all tests to reflect the new API and the removal of definition-based behavior.
- Definition-based registration: Removed
-
6.1.114 Apr 2026 -
6.1.013 Apr 2026 -
6.0.118 Nov 2025 -
6.0.017 Nov 2025Release notes
Open source →What's Changed
Removed attribute-based service registration in favor of automatic service definition registration via Composer's extra config.
Full Changelog: 5.0.1...6.0.0
-
5.0.118 Mar 2025 -
5.0.021 Feb 2025Release notes
Open source →Added
- Method
clear()was added to interfaceGhostwriter\Container\Interface\ContainerInterface - Method
define()was added to interfaceGhostwriter\Container\Interface\ContainerInterface
Changed
- Parameter
$valueofGhostwriter\Container\Container#set()changed fromcallable|objecttoobject - Parameter
$valueofGhostwriter\Container\Interface\ContainerInterface#set()changed fromcallable|objecttoobject
Removed
- Class
Ghostwriter\Container\Exception\ReflectionExceptionhas been deleted - Method
Ghostwriter\Container\Container#purge()was removed - Method
Ghostwriter\Container\Container#register()was removed - Method
Ghostwriter\Container\Interface\ContainerInterface#purge()was removed - Method
Ghostwriter\Container\Interface\ContainerInterface#register()was removed
- Method
-
4.0.502 Feb 2025 -
4.0.401 Feb 2025Nothing published for this version
-
4.0.309 Oct 2024Nothing published for this version
-
4.0.213 Jul 2024Nothing published for this version
-
4.0.122 Jun 2024Nothing published for this version
-
4.0.021 Jun 2024Release notes
Open source →Added
- Class
Ghostwriter\Container\Attribute\Extensionadded - Class
Ghostwriter\Container\Attribute\Factoryadded - Class
Ghostwriter\Container\Attribute\Injectadded - Class
Ghostwriter\Container\List\Aliasesadded - Class
Ghostwriter\Container\List\Bindingsadded - Class
Ghostwriter\Container\List\Buildersadded - Class
Ghostwriter\Container\List\Dependenciesadded - Class
Ghostwriter\Container\List\Extensionsadded - Class
Ghostwriter\Container\List\Factoriesadded - Class
Ghostwriter\Container\List\Instancesadded - Class
Ghostwriter\Container\List\Providersadded - Class
Ghostwriter\Container\List\Tagsadded - Method
purge()added toGhostwriter\Container\Interface\ContainerInterfaceinterface
Changed
- Removed the return type from
Ghostwriter\Container\Container#__clone()method - Changed the name of parameter 0 of
Ghostwriter\Container\Interface\ContainerInterface#alias()fromnametoservice - Changed the name of parameter 1 of
Ghostwriter\Container\Interface\ContainerInterface#alias()fromservicetoalias - Changed the name of parameter 1 of
Ghostwriter\Container\Interface\ContainerInterface#bind()fromabstracttoservice - Changed the name of parameter 1 of
Ghostwriter\Container\Interface\ContainerInterface#factory()fromserviceFactorytofactory
Removed
- Class
Ghostwriter\Container\Instantiatordeleted - Class
Ghostwriter\Container\ParameterBuilderdeleted - Class
Ghostwriter\Container\Reflectordeleted - Class
Ghostwriter\Container\Exception\ReflectorExceptiondeleted - Class
Ghostwriter\Container\Exception\ServiceExtensionAlreadyRegisteredExceptiondeleted
- Class
-
3.0.310 Apr 2024Nothing published for this version
-
3.0.219 Feb 2024Nothing published for this version
-
3.0.106 Feb 2024Nothing published for this version
-
3.0.006 Feb 2024Release notes
Open source →Added
- Method
invoke()was added to interfaceGhostwriter\Container\Interface\ContainerInterface
Changed
- The number of required arguments for
Ghostwriter\Container\Instantiator#__construct()increased from 0 to 2 - Parameter
$reflectorofGhostwriter\Container\Instantiator#construct()was added - Parameter
$parameterBuilderofGhostwriter\Container\Instantiator#construct()was added - Parameter
$containerofGhostwriter\Container\ParameterBuilder#construct()was added
Fixed
ParameterBuilderresolves positional arguments
Removed
- Method
Ghostwriter\Container\Instantiator#buildParameters()was removed - Parameter
$containerofGhostwriter\Container\Instantiator#instantiate()was removed - Parameter
$containerofGhostwriter\Container\ParameterBuilder#build()was removed
- Method
-
2.0.115 Nov 2023Release notes
Open source →Added
- Add
factoryto register aservice factory
Fixed
Buildresolves aliasesParameterBuilderresolves default/nullable values from the containerExtendsupports service name and service type
- Add
-
2.0.012 Nov 2023Release notes
Open source →Changed
- Rename
bindmethod name toregister - Rename
registermethod name toprovide - Rename
providemethod name tobind - Change
callmethod parameter type tocallable - Change
extendmethod 2nd parameter type tostring(MUST be aclass-stringthat implementsExtensionInterface) - Change
invokemethod parameter type tostring(MUST becallable-string, class with__invokemethod or string function namestrim) - Change
setmethod 2nd parameter type tocallable|object. (ThecallableMUST return anobject)
- Rename
-
1.6.026 Jul 2023Nothing published for this version
-
1.5.008 Apr 2023Nothing published for this version
-
1.4.021 Mar 2023Nothing published for this version
-
1.3.017 Jan 2023Nothing published for this version
-
1.2.021 Dec 2022Nothing published for this version
-
1.1.110 Dec 2022Nothing published for this version
-
1.1.026 Nov 2022Nothing published for this version
-
1.0.004 Oct 2022Nothing published for this version
-
0.7.014 Sep 2022Nothing published for this version
-
0.6.005 Jul 2022Nothing published for this version
-
0.5.027 Jun 2022Nothing published for this version
-
0.4.026 May 2022Nothing published for this version
-
0.3.221 May 2022Nothing published for this version
-
0.3.109 May 2022Nothing published for this version
-
0.3.003 May 2022Nothing published for this version
-
0.2.202 May 2022Nothing published for this version
-
0.2.101 May 2022Nothing published for this version
-
0.2.001 May 2022Nothing published for this version
-
0.1.125 Apr 2022Nothing published for this version
-
0.1.025 Apr 2022Nothing published for this version