Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package version parsing can give wrong value #342

Closed
MacFJA opened this issue Feb 17, 2018 · 1 comment
Closed

Package version parsing can give wrong value #342

MacFJA opened this issue Feb 17, 2018 · 1 comment
Labels

Comments

@MacFJA
Copy link

MacFJA commented Feb 17, 2018

Hi,

With PhpMetrics v2.3.2 (probably true with previous versions), the package version parsing from Packagist can result in wrong version number.

Example, the package liip/imagine-bundle output the lastest version to be 2.01.0, but the lastest release is 1.9.1.

The issue is from the line https://github.com/phpmetrics/PhpMetrics/blob/master/src/Hal/Metric/System/Packages/Composer/Packagist.php#L40:
It strip all chars that are not a digit or a dot, but in the case of liip/imagine-bundle, a branch (which are display as a version in packagist) is named dev-upgrade-2.0-from-1.0, and so result into 2.01.0.

A quick workaround if to ignore all versions that starts with dev- (which are all branch that does represent a version number)
(And ignoing all versions that ends with -dev will get rid of number branches)

UFOMelkor added a commit to UFOMelkor/PhpMetrics that referenced this issue May 8, 2018
@UFOMelkor
Copy link
Member

Fixed in #337

@UFOMelkor UFOMelkor added the bug label May 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants