Skip to content

Commit 1b0075a

Browse files
Add PHP 8.3 support (#7)
1 parent ff48679 commit 1b0075a

File tree

7 files changed

+23
-10
lines changed

7 files changed

+23
-10
lines changed

.github/workflows/test-application.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ jobs:
3737
env:
3838
SYMFONY_DEPRECATIONS_HELPER: weak
3939

40+
- php-version: '8.3'
41+
coverage: true
42+
dependency-versions: 'highest'
43+
env:
44+
SYMFONY_DEPRECATIONS_HELPER: weak
45+
4046
services:
4147
mysql:
4248
image: mysql:5.7

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ composer.lock
1010

1111
/tests/Application/var
1212
/tests/Application/secrets
13+
14+
phpstan.neon

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "proprietary",
55
"type": "sulu-bundle",
66
"require": {
7-
"php": "8.0.* || 8.1.* || 8.2.*",
7+
"php": "8.0.* || 8.1.* || 8.2.* || 8.3.*",
88
"doctrine/dbal": "^3.3",
99
"doctrine/doctrine-bundle": "^2.5",
1010
"doctrine/orm": "^2.11",
@@ -32,7 +32,7 @@
3232
"phpstan/phpstan-webmozart-assert": "^1.0",
3333
"phpunit/phpunit": "^9.5",
3434
"qossmic/deptrac-shim": "^0.24.0 || ^1.0",
35-
"rector/rector": "^0.15.0",
35+
"rector/rector": "^1.0",
3636
"schranz/test-generator": "^0.4",
3737
"symfony/browser-kit": "^5.4 || ^6.0 || ^7.0",
3838
"symfony/css-selector": "^5.4 || ^6.0 || ^7.0",

phpstan.neon phpstan.dist.neon

File renamed without changes.

rector.php

+11-6
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,25 @@
1717
__DIR__ . '/tests',
1818
]);
1919

20+
$rectorConfig->phpstanConfigs([
21+
__DIR__ . '/phpstan.dist.neon',
22+
// rector does not load phpstan extension automatically so require them manually here:
23+
__DIR__ . '/vendor/phpstan/phpstan-doctrine/extension.neon',
24+
__DIR__ . '/vendor/phpstan/phpstan-symfony/extension.neon',
25+
]);
26+
2027
$rectorConfig->skip([
2128
__DIR__ . '/tests/Application/var',
2229
__DIR__ . '/tests/Application/config',
2330
]);
2431

25-
$rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon');
26-
2732
// basic rules
2833
$rectorConfig->importNames();
2934
$rectorConfig->importShortClasses(false);
3035

3136
$rectorConfig->sets([
3237
SetList::CODE_QUALITY,
33-
LevelSetList::UP_TO_PHP_80,
38+
// LevelSetList::UP_TO_PHP_80,
3439
]);
3540

3641
// symfony rules
@@ -39,7 +44,7 @@
3944
$rectorConfig->sets([
4045
SymfonySetList::SYMFONY_CODE_QUALITY,
4146
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
42-
SymfonyLevelSetList::UP_TO_SYMFONY_54,
47+
// SymfonyLevelSetList::UP_TO_SYMFONY_54,
4348
]);
4449

4550
// doctrine rules
@@ -49,7 +54,7 @@
4954

5055
// phpunit rules
5156
$rectorConfig->sets([
52-
PHPUnitLevelSetList::UP_TO_PHPUNIT_90,
53-
PHPUnitSetList::PHPUNIT_91,
57+
// PHPUnitLevelSetList::UP_TO_PHPUNIT_90,
58+
// PHPUnitSetList::PHPUNIT_91,
5459
]);
5560
};

src/Infrastructure/Symfony/Messenger/FlushMiddleware/DoctrineFlushMiddleware.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function handle(Envelope $envelope, StackInterface $stack): Envelope
2222
$envelope = $stack->next()->handle($envelope, $stack);
2323

2424
// flush unit-of-work to the database after the root message was handled successfully
25-
if (!empty($envelope->all(EnableFlushStamp::class))) {
25+
if ([] !== $envelope->all(EnableFlushStamp::class)) {
2626
$this->container->get('doctrine.orm.entity_manager')->flush();
2727
}
2828

tests/Unit/Infrastructure/Symfony/Messenger/UnpackExceptionMiddleware/UnpackExceptionMiddlewareTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private function createEnvelope(): Envelope
5656
return new Envelope(new \stdClass());
5757
}
5858

59-
private function createStack(callable $handler = null): StackMiddleware
59+
private function createStack(?callable $handler = null): StackMiddleware
6060
{
6161
if (!$handler) {
6262
return new StackMiddleware([]);

0 commit comments

Comments
 (0)