phar-io/version

Add support for 4.x and 4.* version constraints

fabioneves opened this issue · 2 comments

Hey!

Would it be possible to add support for "x" and "*" for minor and patch versions?

Thanks!

Hi!

According to the test data we have in VersionConstraintParserTest, '*' should already be supported. As for 'x', that would of course be possible to implement, but is there a specific use-case for it?

If so, adding two more lines to VersionConstraintParserTest::versionStringProvider() would be a good starting point for implementing support for it:

['5.1.x', new SpecificMajorAndMinorVersionConstraint('5.1.x', 5, 1)],
['5.x', new SpecificMajorVersionConstraint('5.x', 5)],

This will give you two failing tests, so you then could add the necessary code to make them pass :)

Hey!

Thanks for the fast reply. There isn't any specific use case for it, just an extra option to '*' :)

Thanks again, will do.
Cheers!