NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #1385 most downloaded on Packagist
Value Object that represents a SemVer-compliant version number.
Latest stable
4.2.1
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 1 weeks to 2.6 years
Most releases are documented
notes for 19 of 22 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
23 releases · first in 2015
Drag across the ruler to compare, or tap a release to open it.
Fix .gitattributes by @VincentLanglet in #41
Full Changelog: 4.2.0...4.2.1
Full Changelog: https://github.com/nikolaposa/version/compare/4.2.0...4.2.1
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Updated code to use PHP 8 syntax
36: Add CS / SA files to .gitattributes
Migration to GitHub Actions thanks to Andreas Möller
PHPUnit 8 is now the minimum required version
VersionsCollection to VersionCollectionVersion->getPreRelease() now explicitly returns nullable typeVersion->getBuild() now explicitly returns nullable typeVersion::fromParts() to Version::from()Version->getVersionString() to Version->toString()beberlei/assert library for input validationVersion\Comparator namespace to Version\ComparisonVersion\Constraint namespace to Version\Comparison\ConstraintComparatorInterface to ComparatorComparisonConstraint to OpeationConstraintComparisonConstraintParser to OpeationConstraintParserVersion\Exception\ExceptionInterface to Version\Exception\VersionExceptionVersion\Comparision\Exception namespace-Exception suffix from all concrete exception namesBaseExtension to ExtensionPreRelease::fromIdentifiers() to PreRelease::from()Build::fromIdentifiers() to Build::from()PreRelease::fromIdentifiersString() to PreRelease::fromString()Build::fromIdentifiersString() to Build::fromString()Version\VersionAwareInterfaceVersion\VersionAwareTraitVersion\Extension\NoPreReleaseVersion\Extension\NoBuildVersion->isBuild()VersionCollection->sort()PreRelease->isEmpty()PreRelease->__toString()Build->isEmpty()Build->__toString()OperationConstraint::equalsTo() named constructorOperationConstraint::notEqualTo() named constructorOperationConstraint::greaterThan() named constructorOperationConstraint::greaterOrEqualTo() named constructorOperationConstraint::lessThan() named constructorOperationConstraint::lessOrEqualTo() named constructorVersion::fromString() is captured and included in toString() resultVersionsCollection to VersionCollectionVersion->getPreRelease() now explicitly returns nullable typeVersion->getBuild() now explicitly returns nullable typeVersion::fromParts() to Version::from()Version->getVersionString() to Version->toString()beberlei/assert library for input validationVersion\Comparator namespace to Version\ComparisonVersion\Constraint namespace to Version\Comparison\ConstraintComparatorInterface to ComparatorComparisonConstraint to OpeationConstraintComparisonConstraintParser to OpeationConstraintParserVersion\Exception\ExceptionInterface to Version\Exception\VersionExceptionVersion\Comparision\Exception namespace-Exception suffix from all concrete exception namesBaseExtension to ExtensionPreRelease::fromIdentifiers() to PreRelease::from()Build::fromIdentifiers() to Build::from()PreRelease::fromIdentifiersString() to PreRelease::fromString()Build::fromIdentifiersString() to Build::fromString()Version\VersionAwareInterfaceVersion\VersionAwareTraitVersion\Extension\NoPreReleaseVersion\Extension\NoBuildVersion->isBuild()VersionCollection->sort()PreRelease->isEmpty()PreRelease->__toString()Build->isEmpty()Build->__toString()OperationConstraint::equalsTo() named constructorOperationConstraint::notEqualTo() named constructorOperationConstraint::greaterThan() named constructorOperationConstraint::greaterOrEqualTo() named constructorOperationConstraint::lessThan() named constructorOperationConstraint::lessOrEqualTo() named constructorVersion::fromString() is captured and included in toString() result23: Allow setting custom comparison strategy
Add immutable VersionsCollection::sortedAscending() and VersionsCollection::sortedDescending() methods; mark VersionsCollection::sort() as deprecated
VersionsCollection::isEmpty() methodVersionsCollection::toArray() methodVersionsCollection::sortedAscending() and VersionsCollection::sortedDescending() methods; mark VersionsCollection::sort() as deprecatedVersionsCollection::first() methodVersionsCollection::last() methodVersionsCollection::majorReleases() methodVersionsCollection::minorReleases() methodVersionsCollection::patchReleases() methodFixed Lower PHP version requirement
VersionsCollection::matching() fails if all the versions do not satisfy constraint; allow VersionsCollection to be empty
VersionsCollection::matching() fails if all the versions do not satisfy constraint; allow VersionsCollection to be emptyStrict typing wherever possible
Version::fromElements() to Version::fromParts()Version::fromParts() requires PreRelease and Build instancesVersion::withMajorIncremented() to Version::incrementMajor()Version::withMinorIncremented() to Version::incrementMinor()Version::withPatchIncremented() to Version::incrementPatch()VersionAwareInterfaceVersion::from(Major|Minor|Path|PreRelease|Build) named constructors in favor of having a single Version::fromParts() named constructor with optional parametersVersionCollection::fromArray(); constructor with variadic Version arguments should be used instead11: Include version string in the exception message
Using friendsofphp/php-cs-fixer instead of abandoned fabpot/php-cs-fixer.
8: Mechanism for matching versions against constraints.
Version::isNotEqualTo() method.5: Version is now JsonSerializable.
fromArray) for creating VersionsCollection.Hooked PHP Coding Standards Fixer into the Travis CI.
null values.Static factory methods, for example Version::fromMajor(), Version::fromPreRelease().
Version::fromMajor(), Version::fromPreRelease().increment* methods in Version\Version class were renamed to with*Incremented.Version\Identifier\PreRelease renamed to Version\Identifier\PreReleaseIdentifier.Version\Identifier\Build renamed to Version\Identifier\BuildIdentifier.- ignore composer.lock - .gitattributes
Nothing published for this version
Nothing published for this version
- version-aware interface/trait - versions collection
improved version string parsing
Nothing published for this version
Nothing published for this version
One column per quarter.