Skip to content

Commit

Permalink
PHP 8.2 support (#1279)
Browse files Browse the repository at this point in the history
* PHP 8.2 support

* wip

* Apply fixes from StyleCI

* wip

* wip

* wip

* Update tests.yml

Co-authored-by: StyleCI Bot <[email protected]>
  • Loading branch information
driesvints and StyleCIBot authored Sep 8, 2022
1 parent bc56e30 commit d0d42ac
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ['7.0', 7.1, 7.2, 7.3, 7.4, '8.0', 8.1]
php: ['7.0', 7.1, 7.2, 7.3, 7.4, '8.0', 8.1, 8.2]

name: PHP ${{ matrix.php }}

Expand Down
1 change: 1 addition & 0 deletions cli/Valet/Brew.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Brew
{
const SUPPORTED_PHP_VERSIONS = [
'php',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
Expand Down
2 changes: 1 addition & 1 deletion cli/Valet/PhpFpm.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function fpmConfigPath($phpVersion = null)
$versionNormalized = $this->normalizePhpVersion($phpVersion === 'php' ? Brew::LATEST_PHP_VERSION : $phpVersion);
$versionNormalized = preg_replace('~[^\d\.]~', '', $versionNormalized);

return BREW_PREFIX."/etc/php/${versionNormalized}/php-fpm.d/valet-fpm.conf";
return BREW_PREFIX."/etc/php/{$versionNormalized}/php-fpm.d/valet-fpm.conf";
}

/**
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertDeprecationsToExceptions="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
Expand Down
4 changes: 4 additions & 0 deletions tests/BrewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ public function test_has_installed_php_indicates_if_php_is_installed_via_brew()
$brew->shouldReceive('installedPhpFormulae')->andReturn(collect(['[email protected]']));
$this->assertFalse($brew->hasInstalledPhp());

$brew = Mockery::mock(Brew::class.'[installedPhpFormulae]', [new CommandLine, new Filesystem]);
$brew->shouldReceive('installedPhpFormulae')->andReturn(collect(['[email protected]']));
$this->assertTrue($brew->hasInstalledPhp());

$brew = Mockery::mock(Brew::class.'[installedPhpFormulae]', [new CommandLine, new Filesystem]);
$brew->shouldReceive('installedPhpFormulae')->andReturn(collect(['[email protected]']));
$this->assertTrue($brew->hasInstalledPhp());
Expand Down

0 comments on commit d0d42ac

Please sign in to comment.