All notable changes of the jean85/pretty-package-versions
package are documented in this file using the
Keep a CHANGELOG principles.
- Add CI tests for PHP 8.4
- Bump minimum PHP version to 7.4
- Bump minimum Composer version to 2.1.0
- PHP 8.2 and 8.3 support verified
- Optimized package distribution via .gitattributes (#44 #46, thanks @villfa @VincentLanglet)
- PHP 8.1 support verified
- Added the
Version::NO_VERSION_TEXT
constant to retrieve the string used when no version is available (#41)
- Handle with
Version::NO_VERSION_TEXT
constant when no version is available due to replaced package (#41)
- Handle deprecation of
InstalledVersions::getRawData()
from Composer 2.0.14 (#39, thanks @BramRoets)
- Added the
Version::NO_REFERENCE_TEXT
constant to retrieve the string used when no reference is available (#38, thanks @DeyV)
- Retrieve root package information without indirection (a1cfeec)
- Handle
null
as reference when constructingVersion
(#36)
This small patch handles replaced and provided packages, so that consumers of this library can handle bad requests gracefully.
- Add
VersionMissingExceptionInterface
, and two exceptions implementing it:ProvidedPackageException
andReplacedPackageException
- Throw explicit
ProvidedPackageException
when asking for the version of a package which is provided (was\TypeError
before) - Throw explicit
ReplacedPackageException
when asking for the version of a package which is replaced (was\TypeError
before)
This release is aimed to become a bridge for native Composer 2 support. The BC breaks are minimal; if you're using it in a library, you're encouraged to require it with ^1.5 || ^2.0
, so that your end users will not be constrained to use a specific Composer version.
Version
methods added:getReference
,getShortReference
,getVersionWithShortReference
(see table below)
- Use Composer 2 API directly to retrieve versions
Version
methods deprecated; this is a simple rename (commit
toreference
), to better reflect the meaning of Composer API data; the old methods are preserved but deprecated to reduce breaking changes:
New method | Old, deprecated method |
---|---|
Version::getReference() |
Version::getCommitHash() |
Version::getShortReference() |
Version::getShortCommitHash() |
Version::getVersionWithShortReference() |
Version::getVersionWithShortCommit() |
- Drop PHP 7.0 support
- Drop Composer 1 support
- Drop dependencies
- [BC BREAK] Constant
PrettyVersions::SHORT_COMMIT_LENGTH
removed - [BC BREAK] Constant
Version::SHORT_COMMIT_LENGTH
made private - [BC BREAK]
Version
constructor changed arguments: second argumentstring $version
has been split intostring $prettyVersion, string $reference
- Add forward compatibility layer for newer methods in 2.0 (see the 2.0 changelog)
- PHP 8 support (#28)
This release is intended to change the future release plan of this package. Please require the package with ^1.5 || ^2.0
to ensure full functionalities and future Composer 2 compatibility.
- Add
PrettyVersions::getRootPackageName
as a compatibility layer to be used in place ofPackageVersions\Versions::ROOT_PACKAGE_NAME
, which would be a transient dependency (#23) - Add
PrettyVersions::getRootPackageVersion
, a shortcut toPrettyVersions::getVersion(PrettyVersions::getRootPackageName())
(#23)
- Roll back to use
composer/package-versions-deprecated
as in 1.3 (see #21 & #22)
- Drop support for Composer 1
- Drop dependency on any package
- Drop Scrutinizer, use Codecov for test coverage
- Switched dependency from
ocramius/package-versions
to its forkcomposer/package-versions-deprecated
, to ensure compatibility with both PHP 7.* and Composer 2 (see #13, thanks @dereuromark and @seldaek)
- Add
Version::__getShortCommitHash()
method (see #8, thanks @emodric)
- Add
Version::__toString()
method (see #5)
- Require at least
ocramius/package-versions
1.2 to fix root package version (see #3)
- Use this package with Composer >= 1.5.3 to fix root package version when in version-branch (see #4)
- Add PHP 7.2 to the build matrix for official support
- Require at least
ocramius/package-versions
1.1.3 to avoid issues when removing the package (see this issue)
- Make the package lightweight thanks to the
.gitattributes
file (#1)
First release
Jean85\PrettyVersions
wraps thePackageVersions\Versions
class and returns aJean85\Version
object- The
Jean85\Version
has these methods available:public function getPrettyVersion(): string
public function getFullVersion(): string
public function getVersionWithShortCommit(): string
public function getPackageName(): string
public function getShortVersion(): string
public function getCommitHash(): string