From d59f8eaae4ff9ce4830b5598e2533c6efd8e1270 Mon Sep 17 00:00:00 2001 From: aarongerig Date: Thu, 18 Aug 2022 10:34:00 +0200 Subject: [PATCH] fix: replace PackageVersions\Versions with Composer\InstalledVersions --- src/PimcoreMonitorBundle/Check/PimcoreVersion.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/PimcoreMonitorBundle/Check/PimcoreVersion.php b/src/PimcoreMonitorBundle/Check/PimcoreVersion.php index 751613c..f525e25 100644 --- a/src/PimcoreMonitorBundle/Check/PimcoreVersion.php +++ b/src/PimcoreMonitorBundle/Check/PimcoreVersion.php @@ -17,16 +17,14 @@ namespace Wvision\Bundle\PimcoreMonitorBundle\Check; +use Composer\InstalledVersions; use Laminas\Diagnostics\Result\ResultInterface; use Laminas\Diagnostics\Result\Skip; use Laminas\Diagnostics\Result\Success; -use PackageVersions\Versions; class PimcoreVersion extends AbstractCheck { protected const IDENTIFIER = 'pimcore:version'; - protected const PART_SEMVER = 0; - protected const PART_REFERENCE = 1; protected bool $skip; @@ -44,11 +42,11 @@ public function check(): ResultInterface return new Skip('Check was skipped'); } - $version = explode('@', Versions::getVersion('pimcore/pimcore')); + $version = InstalledVersions::getPrettyVersion('pimcore/pimcore'); - return new Success(sprintf('The system is running on Pimcore %s', $version[self::PART_SEMVER]), [ - 'semver' => $version[self::PART_SEMVER], - 'reference' => $version[self::PART_REFERENCE], + return new Success(sprintf('The system is running on Pimcore %s', $version), [ + 'semver' => $version, + 'reference' => InstalledVersions::getReference('pimcore/pimcore'), ]); }