Skip to content

Commit

Permalink
Handle varying composer -V outputs (#43286)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrooksuk authored Jul 19, 2022
1 parent a8a529d commit fbf40ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Illuminate/Support/Composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ public function getVersion()

$output = $process->getOutput();

if (preg_match('/(\d+(\.\d+){2})/', $output, $version)) {
return $version[1];
}

return explode(' ', $output)[2] ?? null;
}
}

0 comments on commit fbf40ed

Please sign in to comment.