I think ProjectVersioner\Reader\Composer and ProjectVersioner\Reader\ComposerPackage could easily be merged together, where an optional constructor argument would supply a specific package version to read. If omitted, a version over all packages (i.e. composer.lock hash) would be returned.
This leaves more room for a Composer reader that reads the composer.json file and returns the version value if defined in that file. Since version it's optional for composer.json and never present in composer.lock you cannot rely on it, but in most cases it will be the version one wants to retrieve.
I think
ProjectVersioner\Reader\ComposerandProjectVersioner\Reader\ComposerPackagecould easily be merged together, where an optional constructor argument would supply a specific package version to read. If omitted, a version over all packages (i.e.composer.lockhash) would be returned.This leaves more room for a Composer reader that reads the
composer.jsonfile and returns theversionvalue if defined in that file. Sinceversionit's optional for composer.json and never present in composer.lock you cannot rely on it, but in most cases it will be the version one wants to retrieve.