composer / package-versions-deprecated

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

Document return type #12

Closed greg0ire closed 3 years ago

greg0ire commented 3 years ago

I'm not 100% this is accurate, but 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
greg0ire commented 3 years ago

:thinking: while technically true, this gives not much more information. I think we will end up reverting part of https://github.com/doctrine/dbal/commit/3ee27c32a75bc3ea379395b81973e1fdeae72632 and not need this.

greg0ire commented 3 years ago

As pointed out by @morozov, the issue cannot be reproduced locally, because for some reason, the code generation results in doctrine/dbal being in the list locally, while in GA, __root__ is used instead. I don't think my contribution is valid then, but I think there is an issue somewhere.

greg0ire commented 3 years ago

Here is the list of packages in the error message for future reference:

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)
morozov commented 3 years ago

@greg0ire since this pull request is closed, do you want to file an open issue instead for better visibility?

greg0ire commented 3 years ago

Sure, see https://github.com/composer/package-versions-deprecated/issues/13