mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 17:35:36 +08:00
Add 8.4 support for switch-php-version command
This commit is contained in:
@@ -19,9 +19,9 @@ class SwitchPhpVersionCommand extends BaseCommand
|
|||||||
$this->addArgument(
|
$this->addArgument(
|
||||||
'php-major-version',
|
'php-major-version',
|
||||||
InputArgument::REQUIRED,
|
InputArgument::REQUIRED,
|
||||||
'PHP major version (supported: 7.4, 8.0, 8.1, 8.2, 8.3)',
|
'PHP major version (supported: 7.4, 8.0, 8.1, 8.2, 8.3, 8.4)',
|
||||||
null,
|
null,
|
||||||
fn () => ['7.4', '8.0', '8.1', '8.2', '8.3']
|
fn () => ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
|
||||||
);
|
);
|
||||||
$this->no_motd = true;
|
$this->no_motd = true;
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ class SwitchPhpVersionCommand extends BaseCommand
|
|||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$php_ver = $this->input->getArgument('php-major-version');
|
$php_ver = $this->input->getArgument('php-major-version');
|
||||||
if (!in_array($php_ver, ['7.4', '8.0', '8.1', '8.2', '8.3'])) {
|
if (!in_array($php_ver, ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4'])) {
|
||||||
// match x.y.z
|
// match x.y.z
|
||||||
preg_match('/^\d+\.\d+\.\d+$/', $php_ver, $matches);
|
preg_match('/^\d+\.\d+\.\d+$/', $php_ver, $matches);
|
||||||
if (!$matches) {
|
if (!$matches) {
|
||||||
|
|||||||
Reference in New Issue
Block a user