Ocramius / PackageVersions

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

Why merge packages and packages-dev? #85

Closed dwenzel closed 5 years ago

dwenzel commented 5 years ago

Why are packages from packages and packages-dev section of composer.lock being merged?

This prevents from reflecting the actual status of installed packages when the composer install command was called with --no-dev parameter.

I'd suggest to implement a method which respects the stability of packages or reflects the actual installation state by adding a flag.

(Unfortunatly the PackageVersions\Installer class is final and the method in question (getVersions()) private.

Ocramius commented 5 years ago

Versions::getVersion() is designed to list installed dependencies, but just tell you the version of a well-known package you want to inspect.

Examples:

All of these work fine with a known package name.

The require-dev is map merged in by design, as "whether a package is installed or not" is not what this API is designed for.