Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Pretty Package Versions Laravel Package

jean85/pretty-package-versions

Lightweight wrapper to fetch human-friendly version strings for installed Composer dependencies. Works across Composer 1 and 2 with a smooth upgrade path, using the appropriate backend (InstalledVersions or package-versions-deprecated) as needed.

View on GitHub
Deep Wiki
Context7
2.1.1

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.0

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.6

Added

  • PHP 8.2 and 8.3 support verified
  • Optimized package distribution via .gitattributes (#44 #46, thanks @villfa @VincentLanglet)
2.0.5

Added

  • PHP 8.1 support verified
  • Added the Version::NO_VERSION_TEXT constant to retrieve the string used when no version is available (#41)

Fixed

  • Handle with Version::NO_VERSION_TEXT constant when no version is available due to replaced package (#41)
2.0.4

Fixed

  • Handle deprecation of InstalledVersions::getRawData() from Composer 2.0.14 (#39, thanks @BramRoets)
2.0.3

Added

  • Added the Version::NO_REFERENCE_TEXT constant to retrieve the string used when no reference is availabled (#38, thanks @DeyV)
1.6.0

Added

  • Add forward compatibility layer for newer methods in 2.0 (see the 2.0 changelog)
2.0.2

Changed

  • Retrieve root package information without indirection (a1cfeec)

Fixed

  • Handle null as reference when constructing Version (#36)
2.0.1

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: ProvidedPackageException and ReplacedPackageException

Fixed

  • 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)
2.0.0

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

  • Version methods added: getReference, getShortReference, getVersionWithShortReference (see table below)

Changed

  • Use Composer 2 API directly to retrieve versions
  • Version methods deprecated; this is a simple rename (commit to reference), 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_LENGTH removed
  • [BC BREAK] Constant Version::SHORT_COMMIT_LENGTH made private
  • [BC BREAK] Version constructor changed arguments: second argument string $version has been split into string $prettyVersion, string $reference
1.5.1

Added

  • PHP 8 support (#28)
1.5.0

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.

Added

  • Add PrettyVersions::getRootPackageName as a compatibility layer to be used in place of PackageVersions\Versions::ROOT_PACKAGE_NAME, which would be a transient dependency (#23)
  • Add PrettyVersions::getRootPackageVersion, a shortcut to PrettyVersions::getVersion(PrettyVersions::getRootPackageName()) (#23)

Changed

  • Roll back to use composer/package-versions-deprecated as in 1.3 (see #21 & #22)
1.4.0

Removed

  • Drop support for Composer 1
  • Drop dependency on any package
  • Drop Scrutinizer, use Codecov for test coverage
1.3.0

Changed

  • Switched dependency from ocramius/package-versions to its fork composer/package-versions-deprecated, to ensure compatibility with both PHP 7.* and Composer 2 (see #13, thanks @dereuromark and @seldaek)
1.2

Added

  • Add Version::__getShortCommitHash() method (see #8, thanks @emodric)
1.1

Added

  • Add Version::__toString() method (see #5)
1.0.3

Changed

  • Require at least ocramius/package-versions 1.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)
1.0.2

Added

  • Add PHP 7.2 to the build matrix for official support

Changed

  • Require at least ocramius/package-versions 1.1.3 to avoid issues when removing the package (see this issue)
1.0.1

Changed

  • Make the package lightweight thanks to the .gitattributes file (#1)
1.0

First release

Changed

  • Jean85\PrettyVersions wraps the PackageVersions\Versions class and returns a Jean85\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
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4