Closed Jean85 closed 6 years ago
I've forced push the fix to avoid garbage in the Git history of the project. Now it should be good to go.
PS: I was thinking about adding a self
key to the versions array as an alias for the root package, what do you think? Obviously I would do it in a separate PR...
@Jean85 seems like you'll need a rebase before I can merge this.
Yep, the funny thing is that I de-synced it myself with #50 :smile:
@Jean85 I see you merged master
into this branch: please do rebase instead.
@Ocramius sorry, I just used the web interface "Update branch" button, and I wasn't sure what it would do.
Rebased :+1:
Ok, I've fixed the mocks as per my comment and also pushed a small refactoring of the mock for the root package in the tests.
In https://github.com/Jean85/pretty-package-versions/issues/3 I was made aware of the fact that the root package version is dumped in a different, normalized style; this is due to the fact that the root package version is not retrieved from the lock file like the other deps, and in the lock file the versions are not normalized.
This PR uses the
PackageInterface::getPrettyVersion()
from Composer to obtain the not-normalized version for the root package, obtaining a more uniform result.This is needed since my wrapper is used as a way to output the current version in PHARs (i.e. PHPStan), where the subject is the root package by design.