Skip to content

Commit

Permalink
Add support for PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
phansys committed Jan 12, 2025
1 parent fe47c6d commit b89ccbf
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 9 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ jobs:
matrix:
php:
- '8.2'
- '8.3'
include:
- php: '8.4'
env:
PHP_CS_FIXER_IGNORE_ENV: '1'
dependencies: ['highest']
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -32,6 +37,8 @@ jobs:

- name: Run PHP-CS-Fixer fix
run: php-cs-fixer fix --dry-run --diff --ansi
env:
PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.env.PHP_CS_FIXER_IGNORE_ENV }}

phpunit:
name: PHPUnit (PHP ${{ matrix.php }}) Symfony ${{ matrix.symfony }}
Expand All @@ -40,11 +47,18 @@ jobs:
matrix:
php:
- '8.2'
- '8.3'
include:
- php: '8.4'
env:
SYMFONY_DEPRECATIONS_HELPER: 'weak'
dependencies: ['highest', 'lowest']
symfony:
- 'unchanged'
- '6.4.*'
- '7.*.*'
env:
- SYMFONY_DEPRECATIONS_HELPER: 'max[direct]=0'
fail-fast: false

services:
Expand All @@ -59,7 +73,7 @@ jobs:
MYSQL_ROOT_PASSWORD: password
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Configure Symfony version
if: matrix.symfony != 'unchanged'
Expand All @@ -72,7 +86,7 @@ jobs:
tools: composer, flex

- name: Install Composer dependencies (${{ matrix.dependencies }})
uses: ramsey/composer-install@v1
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: "--prefer-dist"
Expand All @@ -85,6 +99,8 @@ jobs:
- name: Run tests
run: vendor/bin/phpunit --verbose --stop-on-failure
env:
SYMFONY_DEPRECATIONS_HELPER: ${{ matrix.env.SYMFONY_DEPRECATIONS_HELPER }}

# This is a "trick", a meta task which does not change, and we can use in
# the protected branch rules as opposed to the individual tests which
Expand Down
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
'no_short_bool_cast' => true,
'no_spaces_around_offset' => true,
'no_unused_imports' => true,
'nullable_type_declaration_for_default_null_value' => true,
'ordered_imports' => true,
'phpdoc_order' => true,
'phpdoc_scalar' => true,
Expand Down
2 changes: 1 addition & 1 deletion fixtures/DataFixtures/Loader/FakeLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class FakeLoader implements DataFixturesLoaderInterface
{
use NotCallableTrait;

public function load(array $fixturesFiles, array $parameters = [], array $objects = [], PurgeMode $purgeMode = null): array
public function load(array $fixturesFiles, array $parameters = [], array $objects = [], ?PurgeMode $purgeMode = null): array
{
$this->__call(__METHOD__, func_get_args());
}
Expand Down
2 changes: 1 addition & 1 deletion src/Alice/FileLocator/KernelFileLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(FileLocatorInterface $decoratedFileLocator, KernelIn
$this->kernel = $kernel;
}

public function locate(string $name, string $currentPath = null): string
public function locate(string $name, ?string $currentPath = null): string
{
if ('@' === $name[0]) {
return $this->kernel->locateResource($name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class InstantiatedReferenceInstantiator implements ChainableInstantiatorIn

private ?ContainerInterface $container = null;

public function setContainer(ContainerInterface $container = null): void
public function setContainer(?ContainerInterface $container = null): void
{
$this->container = $container;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected function configure(): void
;
}

public function setApplication(ConsoleApplication $application = null): void
public function setApplication(?ConsoleApplication $application = null): void
{
if (null !== $application
&& !($application instanceof FrameworkBundleConsoleApplication)
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/Resolver/BundleNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class BundleNotFoundException extends RuntimeException
/**
* @param BundleInterface[] $bundles
*/
public static function create(string $bundle, array $bundles, int $code = 0, Throwable $previous = null): self
public static function create(string $bundle, array $bundles, int $code = 0, ?Throwable $previous = null): self
{
return new self(
sprintf(
Expand Down
2 changes: 1 addition & 1 deletion src/Loader/DoctrineOrmLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct(
FixtureLocatorInterface $fixtureLocator,
LoaderInterface $purgeLoader,
LoaderInterface $appendLoader,
LoggerInterface $logger = null
?LoggerInterface $logger = null
) {
$this->bundleResolver = $bundleResolver;
$this->fixtureLocator = $fixtureLocator;
Expand Down

0 comments on commit b89ccbf

Please sign in to comment.