From e8b32e0bec3b1d3ad4234a90ec46c4e59a8127fb Mon Sep 17 00:00:00 2001 From: Adnan RIHAN Date: Sun, 6 Apr 2025 15:33:43 +0200 Subject: [PATCH 1/2] Fix PHP version parsed from composer.json --- recipe/provision/php.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipe/provision/php.php b/recipe/provision/php.php index ef9aef3ac..e7f56d094 100644 --- a/recipe/provision/php.php +++ b/recipe/provision/php.php @@ -6,6 +6,11 @@ $defaultPhpVersion = file_exists('composer.json') ? explode('|', preg_replace('/[^0-9.|]+/', '', json_decode(file_get_contents('composer.json'), true)['require']['php'] ?? '8.3'))[0] : '8.3'; + + if (count(($parts = explode('.', $defaultPhpVersion))) > 2) { + $defaultPhpVersion = "$parts[0].$parts[1]"; + } + return ask(' What PHP version to install? ', $defaultPhpVersion, ['5.6', '7.4', '8.0', '8.1', '8.2']); }); From 6e5a47d3e5bae388d419f522b709419c1e979b50 Mon Sep 17 00:00:00 2001 From: Adnan RIHAN Date: Sun, 6 Apr 2025 15:34:39 +0200 Subject: [PATCH 2/2] Adds PHP 8.3 in the php_version choices --- recipe/provision/php.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/provision/php.php b/recipe/provision/php.php index e7f56d094..5d0e924be 100644 --- a/recipe/provision/php.php +++ b/recipe/provision/php.php @@ -11,7 +11,7 @@ $defaultPhpVersion = "$parts[0].$parts[1]"; } - return ask(' What PHP version to install? ', $defaultPhpVersion, ['5.6', '7.4', '8.0', '8.1', '8.2']); + return ask(' What PHP version to install? ', $defaultPhpVersion, ['5.6', '7.4', '8.0', '8.1', '8.2', '8.3']); }); desc('Installs PHP packages');