Expand description
Subset of composer/semver constraints for the platform check.
Port of VersionParser::parseConstraint(s) (pinned source:
docs/reference/SemverVersionParser.php, extracted from the 2.10.3 phar).
Key rules reproduced:
*/x.*: interval[X...-dev, X+1...-dev), a bare*matches everything;^X.Y.Z/~X.Y.Z: lower bound>= version-dev(when there is no explicit stability suffix), exclusive upper bound< next-dev;>=Vand<Vwithout suffix: the bound becomesV-dev(>=8.1accepts8.1.0-beta1,<2.0rejects2.0.0-beta);>Vand<=Vkeep the version as is;A - B:>= A-dev;<= Bif B has a patch/suffix, else< next(B)-dev;- OR on
||or|, AND on commas/spaces.
Outside the subset (dev-* branches, as aliases, @stability…):
Unsupported, the caller treats the case as out of scope.
Structs§
- Constraint
- OR groups of conjunctions of simple constraints.
- Lower
Bound - Lower bound of a constraint (composer/semver’s
Bound): the smallest admitted version and its inclusivity.None= zero bound (*constraint, or an OR branch without a lower bound). - Unsupported
Constraint
Functions§
- satisfies
- Shortcut: does
versionsatisfyconstraint?