All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning.
- Support larger major version numbers (#149)
- Fixed handling of non-string values (#134)
- Fixed possible cache key clash in the CompilingMatcher memoization (#132)
- Improved performance of CompilingMatcher by memoizing more (#131)
- Added CompilingMatcher::clear to clear all memoization caches
- Revert #129 (Fixed MultiConstraint with MatchAllConstraint) which caused regressions
- Fixed: typo in type definition of Intervals class causing issues with Psalm scanning vendors
- Fixed: type improvements to parseStability
- Fixed: issue comparing disjunctive MultiConstraints to conjunctive ones (#127)
- Fixed: added complete type information using phpstan annotations
- Fixed: constraints in the form of
X || Y, >=Y.1
and other such complex constructs were in some cases being optimized into a more restrictive constraint
- Fixed: internal code cleanups
- Fixed: accidental validation of broken constraints combining ^/~ and wildcards, and -dev suffix allowing weird cases
- Fixed: normalization of beta0 and such which was dropping the 0
- Added: support for
x || @dev
, not very useful but seen in the wild and failed to validate with 1.5.2/1.6.0
- Added: support for
foobar-dev
being equal to dev-foobar
, dev-foobar is the official way to write it but we need to support the other for BC and convenience
- Added: support for constraints like
^2.x-dev
and ~2.x-dev
, not very useful but seen in the wild and failed to validate with 3.0.1
- Fixed: invalid aliases will no longer throw, unless explicitly validated by Composer in the root package
- Fixed: handling of some invalid -dev versions which were seen as valid
- Break: Renamed
EmptyConstraint
, replace it with MatchAllConstraint
- Break: Unlikely to affect anyone but strictly speaking a breaking change,
*.*
and such variants will not match all dev-*
versions anymore, only *
does
- Break: ConstraintInterface is now considered internal/private and not meant to be implemented by third parties anymore
- Added
Intervals
class to check if a constraint is a subsets of another one, and allow compacting complex MultiConstraints into simpler ones
- Added
CompilingMatcher
class to speed up constraint matching against simple Constraint instances
- Added
MatchAllConstraint
and MatchNoneConstraint
which match everything and nothing
- Added more advanced optimization of contiguous constraints inside MultiConstraint
- Added tentative support for PHP 8
- Fixed ConstraintInterface::matches to be commutative in all cases
- Break:
dev-master
, dev-trunk
and dev-default
now normalize to dev-master
, dev-trunk
and dev-default
instead of 9999999-dev
in 1.x
- Break: Removed the deprecated
AbstractConstraint
- Added
getUpperBound
and getLowerBound
to ConstraintInterface. They return Composer\Semver\Constraint\Bound
instances
- Added
MultiConstraint::create
to create the most-optimal form of ConstraintInterface from an array of constraint strings
- Fixed: Allow installing on php 8
- Fixed: accidental validation of broken constraints combining ^/~ and wildcards, and -dev suffix allowing weird cases
- Fixed: normalization of beta0 and such which was dropping the 0
- Added: support for
x || @dev
, not very useful but seen in the wild and failed to validate with 1.5.2/1.6.0
- Added: support for
foobar-dev
being equal to dev-foobar
, dev-foobar is the official way to write it but we need to support the other for BC and convenience
- Added: support for constraints like
^2.x-dev
and ~2.x-dev
, not very useful but seen in the wild and failed to validate with 1.5.2
- Fixed: invalid aliases will no longer throw, unless explicitly validated by Composer in the root package
- Fixed: handling of some invalid -dev versions which were seen as valid
- Fixed: some doctypes
- Fixed: Parsing of aliased version was not validating the alias to be a valid version
- Added: some support for date versions (e.g. 201903) in
~
operator
- Fixed: support for stabilities in
~
operator was inconsistent
- Fixed: collapsing of complex constraints lead to buggy constraints
- Changed: allow multiple numerical identifiers in 'pre-release' version part.
- Changed: add more 'v' prefix support.
- Changed: dropped redundant
test
namespace.
- Changed: minor adjustment in datetime parsing normalization.
- Changed:
ConstraintInterface
relaxed, setPrettyString is not required anymore.
- Changed:
AbstractConstraint
marked deprecated, will be removed in 2.0.
- Changed:
Constraint
is now extensible.
- Break:
VersionConstraint
renamed to Constraint
.
- Break:
SpecificConstraint
renamed to AbstractConstraint
.
- Break:
LinkConstraintInterface
renamed to ConstraintInterface
.
- Break:
VersionParser::parseNameVersionPairs
was removed.
- Changed:
VersionParser::parseConstraints
allows (but ignores) build metadata now.
- Changed:
VersionParser::parseConstraints
allows (but ignores) prefixing numeric versions with a 'v' now.
- Changed: Fixed namespace(s) of test files.
- Changed:
Comparator::compare
no longer throws InvalidArgumentException
.
- Changed:
Constraint
now throws InvalidArgumentException
.
- Added:
Composer\Semver\Comparator
, various methods to compare versions.
- Added: various documents such as README.md, LICENSE, etc.
- Added: configuration files for Git, Travis, php-cs-fixer, phpunit.
- Break: the following namespaces were renamed:
- Namespace:
Composer\Package\Version
-> Composer\Semver
- Namespace:
Composer\Package\LinkConstraint
-> Composer\Semver\Constraint
- Namespace:
Composer\Test\Package\Version
-> Composer\Test\Semver
- Namespace:
Composer\Test\Package\LinkConstraint
-> Composer\Test\Semver\Constraint
- Changed: code style using php-cs-fixer.