Skip to content

Commit f550075

Browse files
Merge pull request #61 from cleverage/60
Upgrade to Symfony 7.3 & PHP 8.4. Fix PHP 8.1
2 parents 2226d7c + 92b8f70 commit f550075

21 files changed

+134
-64
lines changed

.docker/php/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.2-fpm-alpine
1+
FROM php:8.4-fpm-alpine
22

33
ARG UID
44
ARG GID

.github/workflows/quality.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Install PHP with extensions
2020
uses: shivammathur/setup-php@v2
2121
with:
22-
php-version: '8.2'
22+
php-version: '8.4'
2323
coverage: none
2424
tools: composer:v2
2525
- name: Install Composer dependencies (locked)
@@ -36,7 +36,7 @@ jobs:
3636
- name: Install PHP with extensions
3737
uses: shivammathur/setup-php@v2
3838
with:
39-
php-version: '8.2'
39+
php-version: '8.4'
4040
coverage: none
4141
tools: composer:v2
4242
- name: Install Composer dependencies (locked)
@@ -53,7 +53,7 @@ jobs:
5353
- name: Install PHP with extensions
5454
uses: shivammathur/setup-php@v2
5555
with:
56-
php-version: '8.2'
56+
php-version: '8.4'
5757
coverage: none
5858
tools: composer:v2
5959
- name: Install Composer dependencies (locked)
@@ -70,7 +70,7 @@ jobs:
7070
- name: Install PHP with extensions
7171
uses: shivammathur/setup-php@v2
7272
with:
73-
php-version: '8.2'
73+
php-version: '8.4'
7474
coverage: none
7575
tools: composer:v2
7676
- name: Install Composer dependencies (locked)

.github/workflows/test.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,17 @@ jobs:
2222
php-version:
2323
- '8.2'
2424
- '8.3'
25+
- '8.4'
2526
dependencies: [highest]
2627
allowed-to-fail: [false]
2728
symfony-require: ['']
2829
variant: [normal]
2930
include:
31+
- php-version: '8.1'
32+
dependencies: highest
33+
allowed-to-fail: false
34+
symfony-require: 6.4.*
35+
variant: symfony/symfony:"6.4.*"
3036
- php-version: '8.2'
3137
dependencies: highest
3238
allowed-to-fail: false
@@ -35,8 +41,8 @@ jobs:
3541
- php-version: '8.2'
3642
dependencies: highest
3743
allowed-to-fail: false
38-
symfony-require: 7.1.*
39-
variant: symfony/symfony:"7.1.*"
44+
symfony-require: 7.3.*
45+
variant: symfony/symfony:"7.3.*"
4046
- php-version: '8.3'
4147
dependencies: highest
4248
allowed-to-fail: false
@@ -45,8 +51,18 @@ jobs:
4551
- php-version: '8.3'
4652
dependencies: highest
4753
allowed-to-fail: false
48-
symfony-require: 7.1.*
49-
variant: symfony/symfony:"7.1.*"
54+
symfony-require: 7.3.*
55+
variant: symfony/symfony:"7.3.*"
56+
- php-version: '8.4'
57+
dependencies: highest
58+
allowed-to-fail: false
59+
symfony-require: 6.4.*
60+
variant: symfony/symfony:"6.4.*"
61+
- php-version: '8.4'
62+
dependencies: highest
63+
allowed-to-fail: false
64+
symfony-require: 7.3.*
65+
variant: symfony/symfony:"7.3.*"
5066

5167
steps:
5268
- name: Checkout

composer.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@
4747
"doctrine/orm": "^2.9 || ^3.0",
4848
"dragonmantank/cron-expression": "^3.4",
4949
"easycorp/easyadmin-bundle": "^4.8",
50-
"symfony/doctrine-messenger": "^6.4|^7.1",
51-
"symfony/dotenv": "^6.4|^7.1",
52-
"symfony/messenger": "^6.4|^7.1",
53-
"symfony/runtime": "^6.4|^7.1",
54-
"symfony/scheduler": "^6.4|^7.1",
55-
"symfony/string": "^6.4|^7.1",
56-
"symfony/uid": "^6.4|^7.1"
50+
"symfony/doctrine-messenger": "^6.4|^7.3",
51+
"symfony/dotenv": "^6.4|^7.3",
52+
"symfony/messenger": "^6.4|^7.3",
53+
"symfony/runtime": "^6.4|^7.3",
54+
"symfony/scheduler": "^6.4|^7.3",
55+
"symfony/string": "^6.4|^7.3",
56+
"symfony/uid": "^6.4|^7.3"
5757
},
5858
"require-dev": {
5959
"doctrine/doctrine-fixtures-bundle": "^3.4",
@@ -65,11 +65,11 @@
6565
"phpunit/phpunit": "<10.0",
6666
"rector/rector": "*",
6767
"roave/security-advisories": "dev-latest",
68-
"symfony/browser-kit": "^6.4|^7.1",
69-
"symfony/css-selector": "^6.4|^7.1",
70-
"symfony/debug-bundle": "^6.4|^7.1",
68+
"symfony/browser-kit": "^6.4|^7.3",
69+
"symfony/css-selector": "^6.4|^7.3",
70+
"symfony/debug-bundle": "^6.4|^7.3",
7171
"symfony/maker-bundle": "^1.31",
72-
"symfony/web-profiler-bundle": "^6.4|^7.1",
72+
"symfony/web-profiler-bundle": "^6.4|^7.3",
7373
"vincentlanglet/twig-cs-fixer": "^3.3"
7474
},
7575
"conflict": {

rector.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,25 @@
33
declare(strict_types=1);
44

55
use Rector\Config\RectorConfig;
6-
use Rector\Doctrine\Set\DoctrineSetList;
76
use Rector\Set\ValueObject\LevelSetList;
87
use Rector\Symfony\Set\SymfonySetList;
98
use Rector\ValueObject\PhpVersion;
109

1110
return RectorConfig::configure()
12-
->withPhpVersion(PhpVersion::PHP_82)
11+
->withPhpVersion(PhpVersion::PHP_84)
1312
->withPaths([
1413
__DIR__.'/src',
1514
__DIR__.'/tests',
1615
])
17-
->withPhpSets(php82: true)
16+
->withPhpSets(php81: true)
1817
// here we can define, what prepared sets of rules will be applied
19-
->withPreparedSets(
20-
deadCode: true,
21-
codeQuality: true
22-
)
18+
->withComposerBased(doctrine: true)
19+
->withPreparedSets(deadCode: true, codeQuality: true, doctrineCodeQuality: true, symfonyCodeQuality: true)
20+
->withAttributesSets(symfony: true, doctrine: true)
2321
->withSets([
24-
LevelSetList::UP_TO_PHP_82,
22+
LevelSetList::UP_TO_PHP_81,
2523
SymfonySetList::SYMFONY_64,
26-
SymfonySetList::SYMFONY_71,
2724
SymfonySetList::SYMFONY_CODE_QUALITY,
2825
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
29-
SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
30-
DoctrineSetList::DOCTRINE_CODE_QUALITY,
31-
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
3226
])
3327
;

src/Controller/Admin/LogRecordCrudController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
use Symfony\Component\HttpFoundation\RequestStack;
3333
use Symfony\Component\Security\Http\Attribute\IsGranted;
3434

35+
/**
36+
* @phpstan-template TEntity of AbstractCrudController
37+
*
38+
* @phpstan-extends AbstractCrudController<LogRecord>
39+
*/
3540
#[IsGranted('ROLE_USER')]
3641
class LogRecordCrudController extends AbstractCrudController
3742
{

src/Controller/Admin/ProcessExecutionCrudController.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
use Symfony\Component\Security\Http\Attribute\IsGranted;
3535
use Symfony\Contracts\Translation\TranslatorInterface;
3636

37+
/**
38+
* @phpstan-template TEntity of AbstractCrudController
39+
*
40+
* @phpstan-extends AbstractCrudController<ProcessExecution>
41+
*/
3742
#[IsGranted('ROLE_USER')]
3843
class ProcessExecutionCrudController extends AbstractCrudController
3944
{
@@ -117,7 +122,9 @@ public function showLogs(AdminContext $adminContext): RedirectResponse
117122
[
118123
'process' => [
119124
'comparison' => '=',
120-
'value' => $this->getContext()?->getEntity()->getInstance()->getId(),
125+
'value' => $this->getContext()?->getEntity()->getInstance() instanceof ProcessExecution
126+
? $this->getContext()->getEntity()->getInstance()->getId()
127+
: null,
121128
],
122129
]
123130
)

src/Controller/Admin/ProcessScheduleCrudController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
use Symfony\Component\Process\Process;
3737
use Symfony\Component\Scheduler\Trigger\CronExpressionTrigger;
3838

39+
/**
40+
* @phpstan-template TEntity of AbstractCrudController
41+
*
42+
* @phpstan-extends AbstractCrudController<ProcessSchedule>
43+
*/
3944
class ProcessScheduleCrudController extends AbstractCrudController
4045
{
4146
public function __construct(private readonly ProcessConfigurationsManager $processConfigurationsManager)

src/Controller/Admin/UserCrudController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
use Symfony\Component\PasswordHasher\Hasher\Pbkdf2PasswordHasher;
3333
use Symfony\Component\Security\Http\Attribute\IsGranted;
3434

35+
/**
36+
* @phpstan-template TEntity of AbstractCrudController
37+
*
38+
* @phpstan-extends AbstractCrudController<User>
39+
*/
3540
#[IsGranted('ROLE_USER')]
3641
class UserCrudController extends AbstractCrudController
3742
{

src/Entity/ProcessSchedule.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ public function setContext(array $context): void
8787
$this->context = $context;
8888
}
8989

90-
public function getNextExecution(): null
90+
/**
91+
* PHP 8.1 Fatal error: Null can not be used as a standalone type.
92+
*
93+
* @phpstan-ignore missingType.return
94+
*/
95+
public function getNextExecution()
9196
{
9297
return null;
9398
}

0 commit comments

Comments
 (0)