From 7e086e8192cab709a1a2ff9c9a67d7bdc8397ec9 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Wed, 26 Apr 2023 14:41:37 +0100 Subject: [PATCH 1/2] Support PHP 8.2 and use single source of truth --- app/Commands/PhpLogsCommand.php | 2 +- app/Commands/PhpRestartCommand.php | 2 +- app/Commands/PhpStatusCommand.php | 2 +- app/Support/PhpVersion.php | 7 +++++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/Commands/PhpLogsCommand.php b/app/Commands/PhpLogsCommand.php index 88d62b0..ce6868c 100644 --- a/app/Commands/PhpLogsCommand.php +++ b/app/Commands/PhpLogsCommand.php @@ -33,7 +33,7 @@ public function handle() $this->ensurePhpExists(); $version = $this->argument('version'); - $versions = ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']; + $versions = PhpVersion::VERSIONS; abort_if( ! is_null($version) && ! in_array($version, $versions), diff --git a/app/Commands/PhpRestartCommand.php b/app/Commands/PhpRestartCommand.php index 3e6f012..2b34185 100644 --- a/app/Commands/PhpRestartCommand.php +++ b/app/Commands/PhpRestartCommand.php @@ -34,7 +34,7 @@ public function handle() $server = $this->currentServer(); $version = $this->argument('version'); - $versions = ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']; + $versions = PhpVersion::VERSIONS; if (! is_null($version) && ! in_array($version, $versions)) { abort(1, 'PHP version needs to be one of these values: '.implode(', ', $versions).'.'); diff --git a/app/Commands/PhpStatusCommand.php b/app/Commands/PhpStatusCommand.php index 94b8d31..2ff15e4 100644 --- a/app/Commands/PhpStatusCommand.php +++ b/app/Commands/PhpStatusCommand.php @@ -34,7 +34,7 @@ public function handle() $server = $this->currentServer(); $version = $this->argument('version'); - $versions = ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']; + $versions = PhpVersion::VERSIONS; if (! is_null($version) && ! in_array($version, $versions)) { abort(1, 'PHP version needs to be one of these values: '.implode(', ', $versions).'.'); diff --git a/app/Support/PhpVersion.php b/app/Support/PhpVersion.php index 795defc..9932fb6 100644 --- a/app/Support/PhpVersion.php +++ b/app/Support/PhpVersion.php @@ -4,6 +4,13 @@ class PhpVersion { + /** + * The available PHP versions. + * + * @var array + */ + const VERSIONS = ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']; + /** * The PHP version. * From b48120c7e5392fc6617ec66525ee617ce8707478 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Mon, 1 May 2023 11:02:51 +0100 Subject: [PATCH 2/2] Update PhpVersion.php --- app/Support/PhpVersion.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Support/PhpVersion.php b/app/Support/PhpVersion.php index 9932fb6..dc60203 100644 --- a/app/Support/PhpVersion.php +++ b/app/Support/PhpVersion.php @@ -7,7 +7,7 @@ class PhpVersion /** * The available PHP versions. * - * @var array + * @var array */ const VERSIONS = ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'];