jean85/pretty-package-versions
A library to get pretty versions strings of installed dependencies
2.1.1
334M downloads/mo
#130 most downloaded on composer
Jean85/pretty-package-versions
What this package is like to depend on
Last release 1 years ago
19 Mar 2025
Ships unpredictably
gaps range from 2 weeks to 2.4 years
Most releases are documented
notes for 17 of 20 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
20 releases · first in 2017
0 releases in the last 12 months
see the full history below
Release timeline
20 releases · Jul 2017 to Mar 2025Releases
latest 20-
2.1.119 Mar 2025Release notes
Open source →Fixed
- Improve detection of tagged version (handles edge cases like RC1, alpha-2, etc.)
- Do not truncate
{no reference}in short reference when no reference is found
Release notes
Open source →Fixed
- Improve detection of tagged version (handles edge cases like RC1, alpha-2, etc.)
- Do not truncate
{no reference}in short reference when no reference is found
-
2.1.018 Nov 2024Release notes
Open source →Added
- Add CI tests for PHP 8.4
Changed
- Bump minimum PHP version to 7.4
- Bump minimum Composer version to 2.1.0
Release notes
Open source →Added
- Add CI tests for PHP 8.4
Changed
- Bump minimum PHP version to 7.4
- Bump minimum Composer version to 2.1.0
-
2.0.608 Mar 2024Release notes
Open source →Added
- PHP 8.2 and 8.3 support verified
- Optimized package distribution via .gitattributes (#44 #46, thanks @villfa @VincentLanglet)
Release notes
Open source →Added
- PHP 8.2 and 8.3 support verified
- Optimized package distribution via .gitattributes (#44 #46, thanks @villfa @VincentLanglet)
-
2.0.508 Oct 2021Release notes
Open source →Added
- PHP 8.1 support verified
- Added the
Version::NO_VERSION_TEXTconstant to retrieve the string used when no version is available (#41)
Fixed
- Handle with
Version::NO_VERSION_TEXTconstant when no version is available due to replaced package (#41)
Release notes
Open source →Added
- PHP 8.1 support verified
- Added the
Version::NO_VERSION_TEXTconstant to retrieve the string used when no version is available (#41)
Fixed
- Handle with
Version::NO_VERSION_TEXTconstant when no version is available due to replaced package (#41)
-
2.0.426 May 2021Release notes
Open source →Fixed
- Handle deprecation of
InstalledVersions::getRawData()from Composer 2.0.14 (#39, thanks @BramRoets)
Release notes
Open source →Fixed
- Handle deprecation of
InstalledVersions::getRawData()from Composer 2.0.14 (#39, thanks @BramRoets)
- Handle deprecation of
-
2.0.322 Feb 2021Release notes
Open source →Added
- Added the
Version::NO_REFERENCE_TEXTconstant to retrieve the string used when no reference is available (#38, thanks @DeyV)
- Added the
-
2.0.203 Feb 2021Release notes
Open source →Changed
- Retrieve root package information without indirection (a1cfeec)
Fixed
- Handle
nullas reference when constructingVersion(#36)
Release notes
Open source →Changed
- Retrieve root package information without indirection (a1cfeec)
Fixed
- Handle
nullas reference when constructingVersion(#36)
-
2.0.128 Jan 2021Release notes
Open source →This small patch handles replaced and provided packages, so that consumers of this library can handle bad requests gracefully.
Added
- Add
VersionMissingExceptionInterface, and two exceptions implementing it:ProvidedPackageExceptionandReplacedPackageException
Fixed
- Throw explicit
ProvidedPackageExceptionwhen asking for the version of a package which is provided (was\TypeErrorbefore) - Throw explicit
ReplacedPackageExceptionwhen asking for the version of a package which is replaced (was\TypeErrorbefore)
Release notes
Open source →This small patch handles replaced and provided packages, so that consumers of this library can handle bad requests gracefully.
Added
- Add
VersionMissingExceptionInterface, and two exceptions implementing it:ProvidedPackageExceptionandReplacedPackageException
Fixed
- Throw explicit
ProvidedPackageExceptionwhen asking for the version of a package which is provided (was\TypeErrorbefore) - Throw explicit
ReplacedPackageExceptionwhen asking for the version of a package which is replaced (was\TypeErrorbefore)
- Add
-
2.0.014 Jan 2021Release notes
Open source →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.Added
Versionmethods added:getReference,getShortReference,getVersionWithShortReference(see table below)
Changed
- Use Composer 2 API directly to retrieve versions
Versionmethods deprecated; this is a simple rename (committoreference), 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()Removed
- Drop PHP 7.0 support
- Drop Composer 1 support
- Drop dependencies
- [BC BREAK] Constant
PrettyVersions::SHORT_COMMIT_LENGTHremoved - [BC BREAK] Constant
Version::SHORT_COMMIT_LENGTHmade private - [BC BREAK]
Versionconstructor changed arguments: second argumentstring $versionhas been split intostring $prettyVersion, string $reference
Release notes
Open source →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.Added
Versionmethods added:getReference,getShortReference,getVersionWithShortReference(see table below)
Changed
- Use Composer 2 API directly to retrieve versions
Versionmethods deprecated; this is a simple rename (committoreference), 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()Removed
- Drop PHP 7.0 support
- Drop Composer 1 support
- Drop dependencies
- [BC BREAK] Constant
PrettyVersions::SHORT_COMMIT_LENGTHremoved - [BC BREAK] Constant
Version::SHORT_COMMIT_LENGTHmade private - [BC BREAK]
Versionconstructor changed arguments: second argumentstring $versionhas been split intostring $prettyVersion, string $reference
-
1.6.004 Feb 2021Release notes
Open source →Added
- Add forward compatibility layer for newer methods in 2.0 (see the 2.0 changelog)
Release notes
Open source →Added
- Add forward compatibility layer for newer methods in 2.0 (see the 2.0 changelog)
-
1.5.114 Sep 2020 -
1.5.023 Jun 2020Nothing published for this version
-
1.4.028 Apr 2020Nothing published for this version
-
1.3.024 Apr 2020Nothing published for this version
-
1.0.330 Nov 2017Release notes
Open source →Changed
- Require at least
ocramius/package-versions1.2 to fix root package version (see #3)
Known issues
- Use this package with Composer >= 1.5.3 to fix root package version when in version-branch (see #4)
- Require at least
-
1.0.206 Sep 2017Release notes
Open source →Added
- Add PHP 7.2 to the build matrix for official support
Changed
- Require at least
ocramius/package-versions1.1.3 to avoid issues when removing the package (see this issue)
-
1.0.106 Jul 2017Release notes
Open source →Changed
- Make the package lightweight thanks to the
.gitattributesfile (#1)
- Make the package lightweight thanks to the
-
1.213 Jun 2018Release notes
Open source →Added
- Add
Version::__getShortCommitHash()method (see #8, thanks @emodric)
- Add
-
1.121 Jan 2018 -
1.006 Jul 2017Release notes
Open source →First release
Changed
Jean85\PrettyVersionswraps thePackageVersions\Versionsclass and returns aJean85\Versionobject- The
Jean85\Versionhas these methods available:public function getPrettyVersion(): stringpublic function getFullVersion(): stringpublic function getVersionWithShortCommit(): stringpublic function getPackageName(): stringpublic function getShortVersion(): stringpublic function getCommitHash(): string