Skip to content

Upgrading laminas/laminas-servicemanager 3 to 4

Breaking3.24.0 → 4.5.1Breaking21Platform3New5Changed6Fixed2Other16

BreakingUpgrade verdict

17 breaking changes and 3 platform requirement changes.

  • Removes deprecated AbstractFactoryInterface, FactoryInterface, InitializerInterface and DelegatorFactoryInterface.
  • Removes vendor/bin CLI commands in favor of laminas-cli integration, accessible via vendor/bin/laminas servicemanager:<command>.
  • Removes deprecated ConfigInterface and Config class, which only proxied the configuration array without validation.
  • Removes AbstractPluginManager#validate and $instanceOf; use AbstractSingleInstancePluginManager for single-instance plugin managers.
Top 5 of 20 that need code or config changes

Adds brick/varexporter ^0.3.8 || ^0.4.0 || ^0.5.0 || ^0.6.0.

Moves psr/container ^1.0 → ^1.1 || ^2.0. Your build may pick other versions.

Breaking17
Removes deprecated AbstractFactoryInterface, FactoryInterface, InitializerInterface and DelegatorFactoryInterface.
Laminas\ServiceManager\AbstractFactoryInterfaceLaminas\ServiceManager\FactoryInterfaceLaminas\ServiceManager\InitializerInterfaceLaminas\ServiceManager\DelegatorFactoryInterface
Removes vendor/bin CLI commands in favor of laminas-cli integration, accessible via vendor/bin/laminas servicemanager:<command>.
vendor/bin/laminas
Removes deprecated ConfigInterface and Config class, which only proxied the configuration array without validation.
ConfigInterfaceConfig
Removes AbstractPluginManager#validate and $instanceOf; use AbstractSingleInstancePluginManager for single-instance plugin managers.
AbstractPluginManager#validateAbstractPluginManager::$instanceOfAbstractSingleInstancePluginManager
AbstractPluginManager no longer provides validate; extend AbstractSingleInstancePluginManager or implement validate yourself.
AbstractPluginManagerAbstractSingleInstancePluginManagervalidate$instanceOf
AbstractPluginManager#get no longer accepts options; use AbstractPluginManager#build to create instances with options.
AbstractPluginManager#getAbstractPluginManager#build
Removes the deprecated ServiceManager#getServiceLocator method.
ServiceManager#getServiceLocator
Removes AbstractPluginManager#validate.
AbstractPluginManager#validate
Removes deprecated factories.
Removes the container-interop/container-interop polyfill.
container-interop/container-interop
ServiceManager and AbstractPluginManager no longer validate configuration at runtime; psalm types enforce the schema statically.
ServiceManagerAbstractPluginManagerServiceManager#__constructServiceManager#configureAbstractPluginManager#__constructAbstractPluginManager#configure
CLI commands move from vendor/bin to laminas-cli, callable via vendor/bin/laminas once laminas/laminas-cli is required.
vendor/bin/laminas
Modernizes the codebase as part of the 4.0.0 BC break release.
Adds support for psr/container v2, an incompatible major version of the container interface.
psr/container
Converts old CLI standalone commands to laminas-cli commands.
Converts commands to laminas-cli symfony commands.
Adds strict type declarations across the codebase.
Platform3
Removes support for PHP 8.1 and adds support for PHP 8.5.
Adds support for PHP 8.4.
Drops support for PHP versions below 8.1.