laminas/laminas-dependency-plugin
is needed for the case where some of your dependencies want Zend Framework packages. It hooks into composer resolution to rewrite ZF package to its Laminas counterpart.
Each migrated Laminas package provides same versions that were originally released in Zend Framework, and provides composer replace for exact same version of ZF package.
For example, when some of your dependencies want laminas/laminas-stratigility
and some other wants zendframework/zend-stratigility
then composer will install laminas/laminas-stratigility
to satisfy both dependencies. Dependency plugin will have no effect.
However, when some dependency wants zendframework/zend-inputfilter
and nothing wants its Laminas counterpart then composer will install zendframework/zend-inputfilter
. This is where dependency plugin comes into play and rewrites it to laminas/laminas-inputfilter
If nothing is installing zendframework/* packages, you are fine. laminas/laminas-dependency-plugin
is not a hard dependency and you can remove it.
Another compatibility package laminas/laminas-zendframework-bridge
is responsible for dynamically aliasing Zend namespace to Laminas when Zend Framework class autoloading is triggered.
If you are sure nothing in your dependency tree uses Zend Framework packages, you can also remove the bridge package by utilizing replace
in the root composer.json
like this:
"replace": {
"laminas/laminas-zendframework-bridge": "*"
},
Note that this approach is a hack and can potentially break some code unless you tightly control your dependencies. Generally it have negligible impact and removing it won't provide a noticeable benefit.