laminas / laminas-component-installer

Composer plugin for injecting modules and configuration providers into application configuration
https://docs.laminas.dev/laminas-component-installer/
BSD 3-Clause "New" or "Revised" License
27 stars 12 forks source link

Fix type error when trying to discover module dependencies for metapackages #70

Closed Xerkus closed 1 year ago

Xerkus commented 1 year ago
Q A
Documentation no
Bugfix yes
BC Break no
New Feature no
RFC no
QA no

Description

Composer metapackages are not installed same way as other packages. With no install location there is nothing to discover even if metapackage tries to define autoloading rules for whatever reason. No change in effective behavior is introduced.

Starting with composer 2.5.6 the return type for Composer\Installer\InstallationManager::getInstallPath() method becomes nullable. This change fixes type error produced for metapackages with defined extras.

Fixes #69

Xerkus commented 1 year ago

I am not sure how to test this. return type is defined as string, so I can't use mocks to force return of null without bumping composer to latest and I don't want to do that because we do not control composer version.

The test for empty install path has no apparent change in behavior, so not sure how to test that one either.