Skip to content

Commit 15c538b

Browse files
#40 - Mise à jour de la configuration pour PHP 8.5 et ajustements divers
1 parent b15a94f commit 15c538b

20 files changed

+74
-119
lines changed

.docker/php/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.4-fpm-alpine
1+
FROM php:8.5-fpm-alpine
22

33
ARG UID
44
ARG GID
@@ -13,8 +13,7 @@ RUN apk update && apk add \
1313
bash \
1414
icu-dev \
1515
&& docker-php-ext-configure intl \
16-
&& docker-php-ext-install intl opcache \
17-
&& docker-php-ext-enable opcache
16+
&& docker-php-ext-install intl
1817

1918
RUN ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime \
2019
&& sed -i "s/^;date.timezone =.*/date.timezone = Europe\/Paris/" $PHP_INI_DIR/php.ini

.php-cs-fixer.dist.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@
2424

2525
return (new PhpCsFixer\Config())
2626
->setRules([
27-
'@PHP71Migration' => true,
28-
'@PHP82Migration' => true,
29-
'@PHPUnit75Migration:risky' => true,
27+
'@PHP8x2Migration' => true,
28+
'@PHPUnit7x5Migration:risky' => true,
3029
'@Symfony' => true,
3130
'@Symfony:risky' => true,
3231
'@DoctrineAnnotation' => true,

composer.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
{
2323
"name": "Xavier Marchegay",
2424
"email": "xmarchegay@clever-age.com",
25-
"role": "Developer"
25+
"role": "Lead Developer"
2626
}
2727
],
2828
"autoload": {
@@ -36,24 +36,24 @@
3636
}
3737
},
3838
"require": {
39-
"php": ">=8.1",
39+
"php": ">=8.2",
4040
"ext-ctype": "*",
4141
"ext-iconv": "*",
42-
"cleverage/process-bundle": "^4.0",
43-
"doctrine/common": "^3.0",
44-
"doctrine/dbal": "^2.9 || ^3.0",
45-
"doctrine/doctrine-bundle": "^2.5",
46-
"doctrine/doctrine-migrations-bundle": "^3.2",
47-
"doctrine/orm": "^2.9 || ^3.0",
48-
"dragonmantank/cron-expression": "^3.4",
49-
"easycorp/easyadmin-bundle": "^4.8",
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"
42+
"cleverage/process-bundle": "^5.0",
43+
"doctrine/common": "^3.5",
44+
"doctrine/dbal": "^3.10 || ^4.4",
45+
"doctrine/doctrine-bundle": "^2.18 || ^3.1",
46+
"doctrine/doctrine-migrations-bundle": "^3.7 || ^4",
47+
"doctrine/orm": "^2.20 || ^3.5",
48+
"dragonmantank/cron-expression": "^3.6",
49+
"easycorp/easyadmin-bundle": "^4.27",
50+
"symfony/doctrine-messenger": "^6.4 || ^7.4 || ^8",
51+
"symfony/dotenv": "^6.4 || ^7.4 || ^8",
52+
"symfony/messenger":"^6.4 || ^7.4 || ^8",
53+
"symfony/runtime": "^6.4 || ^7.4 || ^8",
54+
"symfony/scheduler": "^6.4 || ^7.4 || ^8",
55+
"symfony/string":"^6.4 || ^7.4 || ^8",
56+
"symfony/uid": "^6.4 || ^7.4 || ^8"
5757
},
5858
"require-dev": {
5959
"doctrine/doctrine-fixtures-bundle": "^3.4",
@@ -62,15 +62,15 @@
6262
"phpstan/phpstan": "*",
6363
"phpstan/phpstan-doctrine": "*",
6464
"phpstan/phpstan-symfony": "*",
65-
"phpunit/phpunit": "<10.0",
65+
"phpunit/phpunit": "*",
6666
"rector/rector": "*",
6767
"roave/security-advisories": "dev-latest",
68-
"symfony/browser-kit": "^6.4|^7.3",
69-
"symfony/css-selector": "^6.4|^7.3",
70-
"symfony/debug-bundle": "^6.4|^7.3",
68+
"symfony/browser-kit": "^6.4 || ^7.4 || ^8",
69+
"symfony/css-selector": "^6.4 || ^7.4 || ^8",
70+
"symfony/debug-bundle": "^6.4 || ^7.4 || ^8",
7171
"symfony/maker-bundle": "^1.31",
72-
"symfony/web-profiler-bundle": "^6.4|^7.3",
73-
"vincentlanglet/twig-cs-fixer": "^3.3"
72+
"symfony/web-profiler-bundle": "^6.4 || ^7.4 || ^8",
73+
"vincentlanglet/twig-cs-fixer": "^3.11"
7474
},
7575
"conflict": {
7676
"symfony/twig-bridge": "7.2.0",

phpunit.xml.dist

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.0/phpunit.xsd"
44
bootstrap="vendor/autoload.php"
5-
cacheResultFile=".phpunit.cache/test-results"
5+
cacheDirectory=".phpunit.cache"
66
executionOrder="depends,defects"
7-
forceCoversAnnotation="true"
8-
beStrictAboutCoversAnnotation="true"
7+
requireCoverageMetadata="true"
8+
beStrictAboutCoverageMetadata="true"
99
beStrictAboutOutputDuringTests="true"
10-
beStrictAboutTodoAnnotatedTests="true"
11-
convertDeprecationsToExceptions="true"
1210
failOnRisky="true"
13-
failOnWarning="true"
14-
verbose="true">
11+
failOnWarning="true">
1512
<testsuites>
1613
<testsuite name="default">
1714
<directory>tests</directory>
1815
</testsuite>
1916
</testsuites>
20-
21-
<coverage cacheDirectory=".phpunit.cache/code-coverage"
22-
processUncoveredFiles="true">
17+
<source>
2318
<include>
2419
<directory suffix=".php">src</directory>
2520
</include>
26-
</coverage>
27-
</phpunit>
21+
</source>
22+
</phpunit>

rector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
use Rector\ValueObject\PhpVersion;
99

1010
return RectorConfig::configure()
11-
->withPhpVersion(PhpVersion::PHP_84)
11+
->withPhpVersion(PhpVersion::PHP_85)
1212
->withPaths([
1313
__DIR__.'/src',
1414
__DIR__.'/tests',
1515
])
16-
->withPhpSets(php81: true)
16+
->withPhpSets(php82: true)
1717
// here we can define, what prepared sets of rules will be applied
1818
->withComposerBased(doctrine: true)
1919
->withPreparedSets(deadCode: true, codeQuality: true, doctrineCodeQuality: true, symfonyCodeQuality: true)
2020
->withAttributesSets(symfony: true, doctrine: true)
2121
->withSets([
22-
LevelSetList::UP_TO_PHP_81,
22+
LevelSetList::UP_TO_PHP_85,
2323
SymfonySetList::SYMFONY_64,
2424
SymfonySetList::SYMFONY_CODE_QUALITY,
2525
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,

src/Controller/Admin/Process/LaunchAction.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public function __invoke(
5050
ProcessConfigurationsManager $processConfigurationsManager,
5151
AdminContext $context,
5252
): Response {
53-
$processCode = $requestStack->getMainRequest()?->get('process');
54-
if (null === $processCode) {
53+
$processCode = (string) $requestStack->getMainRequest()?->request->get('process');
54+
if ('' === $processCode) {
5555
throw new MissingProcessException();
5656
}
5757
$uiOptions = $processConfigurationsManager->getUiOptions($processCode);

src/Controller/Admin/Process/UploadAndExecuteAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __invoke(
4949
$form = $this->createForm(
5050
ProcessUploadFileType::class,
5151
null,
52-
['process_code' => $requestStack->getMainRequest()?->get('process')]
52+
['process_code' => $requestStack->getMainRequest()?->request->get('process')]
5353
);
5454
$form->handleRequest($requestStack->getMainRequest());
5555
if ($form->isSubmitted() && $form->isValid()) {

src/Entity/ProcessSchedule.php

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

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()
90+
public function getNextExecution(): null
9691
{
9792
return null;
9893
}

src/EventSubscriber/ProcessEventSubscriber.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,12 @@
2222
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
2323
use Symfony\Component\Uid\Uuid;
2424

25-
/**
26-
* PHP 8.2 : Replace by readonly class.
27-
*/
28-
final class ProcessEventSubscriber implements EventSubscriberInterface
25+
readonly final class ProcessEventSubscriber implements EventSubscriberInterface
2926
{
3027
public function __construct(
31-
private readonly ProcessHandler $processHandler,
32-
private readonly DoctrineProcessHandler $doctrineProcessHandler,
33-
private readonly ProcessExecutionManager $processExecutionManager,
28+
private ProcessHandler $processHandler,
29+
private DoctrineProcessHandler $doctrineProcessHandler,
30+
private ProcessExecutionManager $processExecutionManager,
3431
) {
3532
}
3633

src/Http/Model/HttpProcessExecution.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,18 @@
2020
use Symfony\Component\Validator\Constraints\Sequentially;
2121
use Symfony\Component\Validator\Constraints\Type;
2222

23-
/**
24-
* PHP 8.2 : Replace by readonly class.
25-
*/
26-
final class HttpProcessExecution
23+
final readonly class HttpProcessExecution
2724
{
2825
/**
2926
* @param string|array<string|int, mixed> $context
3027
*/
3128
public function __construct(
3229
#[Sequentially(constraints: [new NotNull(message: 'Process code is required.'), new IsValidProcessCode()])]
33-
public readonly ?string $code = null,
34-
public readonly ?string $input = null,
30+
public ?string $code = null,
31+
public ?string $input = null,
3532
#[AtLeastOneOf(constraints: [new Json(), new Type('array')])]
36-
public readonly string|array $context = [],
37-
public readonly bool $queue = true,
33+
public string|array $context = [],
34+
public bool $queue = true,
3835
) {
3936
}
4037
}

0 commit comments

Comments
 (0)