Skip to content

Commit

Permalink
fix: replace PackageVersions\Versions with Composer\InstalledVersions
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongerig committed Aug 18, 2022
1 parent 57b3fd2 commit d59f8ea
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/PimcoreMonitorBundle/Check/PimcoreVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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'),
]);
}

Expand Down

0 comments on commit d59f8ea

Please sign in to comment.