composer / package-versions-deprecated

:package: Composer addon to efficiently get installed packages' version numbers
MIT License
1.51k stars 9 forks source link

__root__ used instead of actual package name #13

Closed greg0ire closed 3 years ago

greg0ire commented 3 years ago

In doctrine/dbal,

        $cli = new Application('Doctrine Command Line Interface', Versions::getVersion(
            Versions::rootPackageName()
        ));

gives the following error in some situations:

Error: Argument 1 of PackageVersions\Versions::getVersion expects string(__root__)|string(amphp/amp)|string(amphp/byte-stream)|string(composer/package-versions-deprecated)|string(composer/semver)|string(composer/xdebug-handler)|string(dnoegel/php-xdg-base-dir)|string(felixfbecker/advanced-json-rpc)|string(felixfbecker/language-server-protocol)|string(netresearch/jsonmapper)|string(nikic/php-parser)|string(openlss/lib-array2xml)|string(phpdocumentor/reflection-common)|string(phpdocumentor/reflection-docblock)|string(phpdocumentor/type-resolver)|string(psr/container)|string(psr/log)|string(sebastian/diff)|string(symfony/console)|string(symfony/polyfill-ctype)|string(symfony/polyfill-intl-grapheme)|string(symfony/polyfill-intl-normalizer)|string(symfony/polyfill-mbstring)|string(symfony/polyfill-php73)|string(symfony/polyfill-php80)|string(symfony/service-contracts)|string(symfony/string)|string(vimeo/psalm)|string(webmozart/assert)|string(webmozart/glob)|string(webmozart/path-util), parent type string provided

Note the __root__ in the error message. I'd expect to have doctrine/dbal there. That situation is hard to reproduce, I thought using composer install --no-scripts would do the trick but it doesn't, at least not for me. Here is the formatted list of packages:

string(__root__)
string(amphp/amp)
string(amphp/byte-stream)
string(composer/package-versions-deprecated)
string(composer/semver)
string(composer/xdebug-handler)
string(dnoegel/php-xdg-base-dir)
string(felixfbecker/advanced-json-rpc)
string(felixfbecker/language-server-protocol)
string(netresearch/jsonmapper)
string(nikic/php-parser)
string(openlss/lib-array2xml)
string(phpdocumentor/reflection-common)
string(phpdocumentor/reflection-docblock)
string(phpdocumentor/type-resolver)
string(psr/container)
string(psr/log)
string(sebastian/diff)
string(symfony/console)
string(symfony/polyfill-ctype)
string(symfony/polyfill-intl-grapheme)
string(symfony/polyfill-intl-normalizer)
string(symfony/polyfill-mbstring)
string(symfony/polyfill-php73)
string(symfony/polyfill-php80)
string(symfony/service-contracts)
string(symfony/string)
string(vimeo/psalm)
string(webmozart/assert)
string(webmozart/glob)
string(webmozart/path-util)
Seldaek commented 3 years ago

Sorry but without simple repro case this is unlikely to get fixed..

greg0ire commented 3 years ago

Yeah, I get that, let's close.