1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-04 16:10:08 +01:00

Update normalizePhpVersion regex

Handle "php@8.1"
Simplify the entire method into one block

Co-Authored-By: Nathan Morgan <nathan@fuelingtheweb.com>
This commit is contained in:
Matt Stauffer
2022-03-13 22:17:50 -04:00
parent 7226da5bb7
commit 530e4c30dd
2 changed files with 10 additions and 5 deletions

View File

@@ -311,11 +311,7 @@ public function symlinkPrimaryValetSock($phpVersion)
*/
public function normalizePhpVersion($version)
{
if (strpos($version, 'php') === false) {
$version = 'php'.$version;
}
return preg_replace('/(php)([0-9+])(?:.)?([0-9+])/i', '$1@$2.$3', $version);
return preg_replace('/(?:php@?)?([0-9+])(?:.)?([0-9+])/i', 'php@$1.$2', $version);
}
/**