Skip to content

Commit

Permalink
Merge pull request #142 from eclipxe13/master
Browse files Browse the repository at this point in the history
workaround to debian php version that does not use semver
  • Loading branch information
theseer authored May 12, 2018
2 parents a1a4a31 + 43f3838 commit 9b0ec84
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/services/phar/CompatibilityService.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ public function canRun(Phar $phar) {

case $requirement instanceof PhpVersionRequirement: {
$php = $requirement->getVersionConstraint();
if (!$php->complies(new Version(PHP_VERSION))) {
try {
$phpversion = new Version(PHP_VERSION);
} catch (InvalidVersionException $ex) {
$phpversion = new Version(PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION);
}
if (!$php->complies($phpversion)) {
$issues[] = sprintf(
'PHP Version %s required, but %s in use',
$php,
Expand Down

0 comments on commit 9b0ec84

Please sign in to comment.