nikolaposa/version
Value Object that represents a SemVer-compliant version number.
4.2.1
8.0M downloads/mo
#1119 most downloaded on Packagist
nikolaposa/version
What this package is like to depend on
Last release 1 years ago
24 Mar 2025
Release timing varies
gaps range from 1 weeks to 2.6 years
Most releases are documented
notes for 16 of 22 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
23 releases · first in 2015
0 releases in the last 12 months
see the full history below
Release timeline
23 releases · Sep 2015 to Mar 2025Releases
latest 23-
4.2.124 Mar 2025Release notes
Open source →What's Changed
- Fix .gitattributes by @VincentLanglet in #41
- Explicit nullable types by @yoan-myparcel in #43
New Contributors
- @yoan-myparcel made their first contribution in #43
Full Changelog: 4.2.0...4.2.1
-
4.2.029 Dec 2023Release notes
Open source →Changed
- Updated code to use PHP 8 syntax
- PHP 8.1 is now the minimum required version
- Updated dependencies to their latest versions
Release notes
Open source →Changed
- Updated code to use PHP 8 syntax
- PHP 8.1 is now the minimum required version
- Updated dependencies to their latest versions
-
4.1.104 Aug 2023 -
4.1.012 Dec 2020Release notes
Open source →- 35: Allow PHP 8 installations
- PHPStan integration
- Migration to GitHub Actions thanks to Andreas Möller
Release notes
Open source →- 35: Allow PHP 8 installations
- PHPStan integration
- Migration to GitHub Actions thanks to Andreas Möller
-
4.0.029 Dec 2019Release notes
Open source →Changed
- PHPUnit 8 is now the minimum required version
- Rename
VersionsCollectiontoVersionCollection Version->getPreRelease()now explicitly returns nullable typeVersion->getBuild()now explicitly returns nullable type- Rename
Version::fromParts()toVersion::from() - Rename
Version->getVersionString()toVersion->toString() - Use
beberlei/assertlibrary for input validation - Rename
Version\Comparatornamespace toVersion\Comparison - Move
Version\Constraintnamespace toVersion\Comparison\Constraint - Rename
ComparatorInterfacetoComparator - Rename
ComparisonConstrainttoOpeationConstraint - Rename
ComparisonConstraintParsertoOpeationConstraintParser - Rename component-level
Version\Exception\ExceptionInterfacetoVersion\Exception\VersionException - Move comparision-related exceptions into
Version\Comparision\Exceptionnamespace - Remove
-Exceptionsuffix from all concrete exception names - Rename
BaseExtensiontoExtension - Rename
PreRelease::fromIdentifiers()toPreRelease::from() - Rename
Build::fromIdentifiers()toBuild::from() - Rename
PreRelease::fromIdentifiersString()toPreRelease::fromString() - Rename
Build::fromIdentifiersString()toBuild::fromString()
Removed
Version\VersionAwareInterfaceVersion\VersionAwareTraitVersion\Extension\NoPreReleaseVersion\Extension\NoBuildVersion->isBuild()VersionCollection->sort()PreRelease->isEmpty()PreRelease->__toString()Build->isEmpty()Build->__toString()
Added
OperationConstraint::equalsTo()named constructorOperationConstraint::notEqualTo()named constructorOperationConstraint::greaterThan()named constructorOperationConstraint::greaterOrEqualTo()named constructorOperationConstraint::lessThan()named constructorOperationConstraint::lessOrEqualTo()named constructor- Prefix supplied in
Version::fromString()is captured and included intoString()result
Release notes
Open source →Changed
- PHPUnit 8 is now the minimum required version
- Rename
VersionsCollectiontoVersionCollection Version->getPreRelease()now explicitly returns nullable typeVersion->getBuild()now explicitly returns nullable type- Rename
Version::fromParts()toVersion::from() - Rename
Version->getVersionString()toVersion->toString() - Use
beberlei/assertlibrary for input validation - Rename
Version\Comparatornamespace toVersion\Comparison - Move
Version\Constraintnamespace toVersion\Comparison\Constraint - Rename
ComparatorInterfacetoComparator - Rename
ComparisonConstrainttoOpeationConstraint - Rename
ComparisonConstraintParsertoOpeationConstraintParser - Rename component-level
Version\Exception\ExceptionInterfacetoVersion\Exception\VersionException - Move comparision-related exceptions into
Version\Comparision\Exceptionnamespace - Remove
-Exceptionsuffix from all concrete exception names - Rename
BaseExtensiontoExtension - Rename
PreRelease::fromIdentifiers()toPreRelease::from() - Rename
Build::fromIdentifiers()toBuild::from() - Rename
PreRelease::fromIdentifiersString()toPreRelease::fromString() - Rename
Build::fromIdentifiersString()toBuild::fromString()
Removed
Version\VersionAwareInterfaceVersion\VersionAwareTraitVersion\Extension\NoPreReleaseVersion\Extension\NoBuildVersion->isBuild()VersionCollection->sort()PreRelease->isEmpty()PreRelease->__toString()Build->isEmpty()Build->__toString()
Added
OperationConstraint::equalsTo()named constructorOperationConstraint::notEqualTo()named constructorOperationConstraint::greaterThan()named constructorOperationConstraint::greaterOrEqualTo()named constructorOperationConstraint::lessThan()named constructorOperationConstraint::lessOrEqualTo()named constructor- Prefix supplied in
Version::fromString()is captured and included intoString()result
-
3.2.011 Aug 2019 -
3.1.014 Jun 2018Release notes
Open source →Added
- Support for parsing Composer version strings
- Add
VersionsCollection::isEmpty()method - Add
VersionsCollection::toArray()method - Add immutable
VersionsCollection::sortedAscending()andVersionsCollection::sortedDescending()methods; markVersionsCollection::sort()as deprecated - Add
VersionsCollection::first()method - Add
VersionsCollection::last()method - Add
VersionsCollection::majorReleases()method - Add
VersionsCollection::minorReleases()method - Add
VersionsCollection::patchReleases()method
Release notes
Open source →Added
- Support for parsing Composer version strings
- Add
VersionsCollection::isEmpty()method - Add
VersionsCollection::toArray()method - Add immutable
VersionsCollection::sortedAscending()andVersionsCollection::sortedDescending()methods; markVersionsCollection::sort()as deprecated - Add
VersionsCollection::first()method - Add
VersionsCollection::last()method - Add
VersionsCollection::majorReleases()method - Add
VersionsCollection::minorReleases()method - Add
VersionsCollection::patchReleases()method
-
3.0.228 May 2018 -
3.0.105 May 2018Release notes
Open source →Fixed
VersionsCollection::matching()fails if all the versions do not satisfy constraint; allow VersionsCollection to be empty
Release notes
Open source →Fixed
VersionsCollection::matching()fails if all the versions do not satisfy constraint; allow VersionsCollection to be empty
-
3.0.002 May 2018Release notes
Open source →Added
- Strict typing wherever possible
- 15: Relaxed version parsing
Changed
- 13: PHP 7.2 as minimum requirement
- Renamed
Version::fromElements()toVersion::fromParts() Version::fromParts()requiresPreReleaseandBuildinstances- Renamed
Version::withMajorIncremented()toVersion::incrementMajor() - Renamed
Version::withMinorIncremented()toVersion::incrementMinor() - Renamed
Version::withPatchIncremented()toVersion::incrementPatch() - 14: Simplified modeling of extension parts - pre-release and build
- 16: Simplified Constraint modeling
Removed
- Setter method from the
VersionAwareInterface Version::from(Major|Minor|Path|PreRelease|Build)named constructors in favor of having a singleVersion::fromParts()named constructor with optional parametersVersionCollection::fromArray(); constructor with variadicVersionarguments should be used instead
Release notes
Open source →Added
- Strict typing wherever possible
- 15: Relaxed version parsing
Changed
- 13: PHP 7.2 as minimum requirement
- Renamed
Version::fromElements()toVersion::fromParts() Version::fromParts()requiresPreReleaseandBuildinstances- Renamed
Version::withMajorIncremented()toVersion::incrementMajor() - Renamed
Version::withMinorIncremented()toVersion::incrementMinor() - Renamed
Version::withPatchIncremented()toVersion::incrementPatch() - 14: Simplified modeling of extension parts - pre-release and build
- 16: Simplified Constraint modeling
Removed
- Setter method from the
VersionAwareInterface Version::from(Major|Minor|Path|PreRelease|Build)named constructors in favor of having a singleVersion::fromParts()named constructor with optional parametersVersionCollection::fromArray(); constructor with variadicVersionarguments should be used instead
-
2.2.222 Apr 2018 -
2.2.101 Jan 2017Release notes
Open source →Fixed
- Coding standard fixes
- Using friendsofphp/php-cs-fixer instead of abandoned fabpot/php-cs-fixer.
-
2.2.014 Jul 2016Release notes
Open source →Added
- 8: Mechanism for matching versions against constraints.
- 9: Support for having custom version comparison strategies.
Version::isNotEqualTo()method.
-
2.1.011 Jun 2016Release notes
Open source →Added
- 5: Version is now JsonSerializable.
- 6: Capability for converting Version into array.
- Static factory method (
fromArray) for creating VersionsCollection.
-
2.0.102 Jun 2016Release notes
Open source →Added
- Hooked PHP Coding Standards Fixer into the Travis CI.
Fixed
- Fixed examples in README.
- Creating empty Metadata objects in favor of passing around
nullvalues. - 3: Fix wrong output in readme
- 4: Remove useless cloning
-
2.0.002 Jun 2016Release notes
Open source →Added
- Static factory methods, for example
Version::fromMajor(),Version::fromPreRelease(). - Methods for modifying pre-release and build information of a version.
Backwards-incompatible changes
- Static factory methods (named constructors) are used to instantiate objects instead of constructors.
increment*methods inVersion\Versionclass were renamed towith*Incremented.Version\Identifier\PreReleaserenamed toVersion\Identifier\PreReleaseIdentifier.Version\Identifier\Buildrenamed toVersion\Identifier\BuildIdentifier.
- Static factory methods, for example
-
1.2.309 Apr 2016Nothing published for this version
-
1.2.209 Apr 2016Nothing published for this version
-
1.2.127 Sep 2015Nothing published for this version
-
1.2.027 Sep 2015Nothing published for this version
-
1.1.026 Sep 2015Nothing published for this version
-
1.0.020 Sep 2015Nothing published for this version
-
1.0.0-alpha19 Sep 2015 pre-releaseNothing published for this version