4.0.0
Closed Mar 4, 2024
100% complete
Release Notes for 4.0.0
laminas-servicemanager
4.0.0 is here and finally enables projects to consume psr/container
v2.0.0 after 2 years along with several type-additions and plugin manager decoupling.
The migration guide is not written yet but will be at some point (once we added support for SM v4 to other components) later.
Added
- Several native type-add…
Release Notes for 4.0.0
laminas-servicemanager
4.0.0 is here and finally enables projects to consume psr/container
v2.0.0 after 2 years along with several type-additions and plugin manager decoupling.
The migration guide is not written yet but will be at some point (once we added support for SM v4 to other components) later.
Added
- Several native type-additions including property-, argument- and return-types and a lot more psalm types
ServiceManager#get
,PluginManagerInterface#get
andServiceLocatorInterface#build
now explicitly implementmixed
as return-type to synchronize types withContainerInterface#get
- Support for
psr/container
v1.1 and v2.0 - Ahead of Time factory creation for services explicitly using
ReflectionBasedAbstractFactory
vialaminas-cli
Removed
- Dropped support for PHP <8.1
- Removed deprecated interfaces such as
Laminas\ServiceManager\AbstractFactoryInterface
Laminas\ServiceManager\FactoryInterface
Laminas\ServiceManager\InitializerInterface
Laminas\ServiceManager\DelegatorFactoryInterface
- CLI commands which were exposed via
vendor/bin
are removed in favor of thelaminas-cli
integration. All CLI commands of v3.x are accessible viavendor/bin/laminas servicemanager:<v3.x command name>
oncelaminas/laminas-cli
is required in the projects dependencies - Removed deprecated
ConfigInterface
andConfig
-class since these files did not provide any validation logic and were just used to proxy the configuration array structure - Removed
AbstractPluginManager#validate
andAbstractPluginManager::$instanceOf
property as in v3.x, implementing plugin managers were able to implicitlyvalidate
mixed
. In case an implementing plugin manager is providing a single$instanceOf
such aslaminas-cache
, there is a new classAbstractSingleInstancePluginManager
available which requires the$instanceOf
property to be configured
Breaking Changes
AbstractPluginManager
does not extendServiceManager
anymore and instead uses an ownServiceManager
instance under the hood to manage plugin manager related services which can be configured the same way as in v3.x- Dedicated CLI commands which were previously linked to
vendor/bin
are now integrated vialaminas-cli
and can be called viavendor/bin/laminas
oncelaminas/laminas-cli
is part of the projects requirements. Read more about how to consume these commands here. AbstractPluginManager
does not provide thevalidate
-Method anymore and requires migration action such as:- extend
AbstractSingleInstancePluginManager
in case the plugin manager only provides instances of a specific interface- or class-string (please be aware that the$instanceOf
property now requires nativestring
property type) - implement
validate
method and verify whatever type has to be returned and/or just allowmixed
as v3.x did when omitting$instanceOf
property
- extend
- Removed deprecated
ConfigInterface
andConfig
-class since these files did not provide any validation logic and were just used to proxy the configuration array structure - neither
ServiceManager
norAbstractPluginManager
do validate the provided configuration at runtime anymore. due to the psalm-types provided toServiceManager#__construct
,ServiceManager#configure
,AbstractPluginManager#__construct
andAbstractPluginManager#configure
, the configuration schema is strictly typed and thus, a miss-configuration can be mitigated on static-analysis level prior actual runtime AbstractPluginManager#get
does not accept options anymore, in case an instance with options needs to be created,AbstractPluginManager#build
has to be used
This milestone is closed.
No open issues remain. View closed issues or see open milestones in this repository.