Skip to content

Commit

Permalink
Merge pull request #73 from laravel/php-versions
Browse files Browse the repository at this point in the history
Support PHP 8.2 and use single source of truth
  • Loading branch information
nunomaduro committed May 1, 2023
2 parents aaffeda + b48120c commit 5b084a3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/Commands/PhpLogsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion app/Commands/PhpRestartCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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).'.');
Expand Down
2 changes: 1 addition & 1 deletion app/Commands/PhpStatusCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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).'.');
Expand Down
7 changes: 7 additions & 0 deletions app/Support/PhpVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

class PhpVersion
{
/**
* The available PHP versions.
*
* @var array<int, string>
*/
const VERSIONS = ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'];

/**
* The PHP version.
*
Expand Down

0 comments on commit 5b084a3

Please sign in to comment.