I migrated an application from Zend Framework 3 to Laminas. During the migration, the migration script added the laminas/laminas-dependency-plugin dependency to the composer.json file. After that, I removed this (by running composer remove laminas/laminas-dependency-plugin). For now there are no errors and all the tests are "green", but nevertheless I would like to be sure that the package was really only needed for the migration and I don't have to expect any trouble caused by this missing package.
Is the laminas/laminas-dependency-plugin package needed after a successful completion of the migration from Zend Framework 3 to Laminas?
laminas/laminas-dependency-pluginis 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-stratigilityand some other wantszendframework/zend-stratigilitythen composer will installlaminas/laminas-stratigilityto satisfy both dependencies. Dependency plugin will have no effect.However, when some dependency wants
zendframework/zend-inputfilterand nothing wants its Laminas counterpart then composer will installzendframework/zend-inputfilter. This is where dependency plugin comes into play and rewrites it tolaminas/laminas-inputfilterIf nothing is installing zendframework/* packages, you are fine.
laminas/laminas-dependency-pluginis not a hard dependency and you can remove it.Another compatibility package
laminas/laminas-zendframework-bridgeis 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
replacein the rootcomposer.jsonlike this: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.