Closed ScreamingDev closed 3 years ago
With semver 3, you can do Intervals::compactConstraint - which will reduce it down to the minimum constraint range, but it won't give you any human-readable pretty output like composer constraints, it just outputs ranges using >/< more or less..
For a script I want to gather lots of constraints but also want to remove redundancy. So far I did not figure out how composer/semver can be used to solve this so maybe it is a new feature.
Examples:
< 8.0.2 || < 8.0.2
should be sanitized to< 8.0.2
< 8.0.2 || < 8.0.1
should be sanitized to< 8.0.2
And other types of conjunctions or even more complex scenarios like
~ 7.0 || < 7.5.2 || 6.9.1 || > 7.1 || dev-master
which could be the same as6.9.1 || ~7.0 || dev-master