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..dc60203 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. *