From d67bafb8877941744eb7dc2b1cb64405be6cb94c Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Sat, 7 Dec 2024 17:54:17 +0100 Subject: [PATCH] Drop old versions of PHP and Symfony (#640) * Drop old versions * Run rector --- composer.json | 28 +++++++++---------- src/Action/CompareAction.php | 4 +-- src/Action/IndexAction.php | 4 +-- src/Action/ViewDetailAction.php | 4 +-- src/Action/ViewEntityAction.php | 4 +-- src/Action/ViewRevisionAction.php | 4 +-- src/AuditManager.php | 6 ++-- src/ChangedEntity.php | 8 +++--- ...angedManyToManyEntityRevisionToPersist.php | 12 ++++---- src/EventListener/CacheListener.php | 2 +- src/Revision.php | 4 +-- tests/ClockTest.php | 2 +- 12 files changed, 41 insertions(+), 41 deletions(-) diff --git a/composer.json b/composer.json index 3c14bf30..fbcbe56f 100644 --- a/composer.json +++ b/composer.json @@ -9,17 +9,17 @@ "Audit" ], "require": { - "php": "^8.0", + "php": "^8.1", "doctrine/collections": "^1.8 || ^2.0", "doctrine/dbal": "^3.6", "doctrine/event-manager": "^1.2 || ^2.0", "doctrine/orm": "^2.14 || ^3.0", "doctrine/persistence": "^3.0", "psr/clock": "^1.0", - "symfony/config": "^5.4 || ^6.2 || ^7.0", - "symfony/dependency-injection": "^5.4 || ^6.2 || ^7.0", - "symfony/http-kernel": "^5.4 || ^6.2 || ^7.0", - "symfony/security-core": "^5.4 || ^6.2 || ^7.0", + "symfony/config": "^6.4 || ^7.1", + "symfony/dependency-injection": "^6.4 || ^7.1", + "symfony/http-kernel": "^6.4 || ^7.1", + "symfony/security-core": "^6.4 || ^7.1", "twig/twig": "^3.0" }, "require-dev": { @@ -38,15 +38,15 @@ "psalm/plugin-phpunit": "^0.18", "psalm/plugin-symfony": "^5.0", "rector/rector": "^1.1", - "symfony/browser-kit": "^5.4 || ^6.2 || ^7.0", - "symfony/cache": "^5.4 || ^6.2 || ^7.0", - "symfony/filesystem": "^5.4 || ^6.2 || ^7.0", - "symfony/framework-bundle": "^5.4 || ^6.2 || ^7.0", - "symfony/http-foundation": "^5.4 || ^6.2 || ^7.0", - "symfony/phpunit-bridge": "^6.2", - "symfony/security-bundle": "^5.4 || ^6.2 || ^7.0", - "symfony/twig-bundle": "^5.4 || ^6.2 || ^7.0", - "symfony/var-dumper": "^5.4 || ^6.2 || ^7.0", + "symfony/browser-kit": "^6.4 || ^7.1", + "symfony/cache": "^6.4 || ^7.1", + "symfony/filesystem": "^6.4 || ^7.1", + "symfony/framework-bundle": "^6.4 || ^7.1", + "symfony/http-foundation": "^6.4 || ^7.1", + "symfony/phpunit-bridge": "^6.4 || ^7.1", + "symfony/security-bundle": "^6.4 || ^7.1", + "symfony/twig-bundle": "^6.4 || ^7.1", + "symfony/var-dumper": "^6.4 || ^7.1", "vimeo/psalm": "^5.7" }, "conflict": { diff --git a/src/Action/CompareAction.php b/src/Action/CompareAction.php index 4041fd5f..5c82e8ed 100644 --- a/src/Action/CompareAction.php +++ b/src/Action/CompareAction.php @@ -21,8 +21,8 @@ final class CompareAction { public function __construct( - private Environment $twig, - private AuditReader $auditReader, + private readonly Environment $twig, + private readonly AuditReader $auditReader, ) { } diff --git a/src/Action/IndexAction.php b/src/Action/IndexAction.php index 0cc119f1..d2d7b11a 100644 --- a/src/Action/IndexAction.php +++ b/src/Action/IndexAction.php @@ -20,8 +20,8 @@ final class IndexAction { public function __construct( - private Environment $twig, - private AuditReader $auditReader, + private readonly Environment $twig, + private readonly AuditReader $auditReader, ) { } diff --git a/src/Action/ViewDetailAction.php b/src/Action/ViewDetailAction.php index 3cdc0437..777c53fc 100644 --- a/src/Action/ViewDetailAction.php +++ b/src/Action/ViewDetailAction.php @@ -21,8 +21,8 @@ final class ViewDetailAction { public function __construct( - private Environment $twig, - private AuditReader $auditReader, + private readonly Environment $twig, + private readonly AuditReader $auditReader, ) { } diff --git a/src/Action/ViewEntityAction.php b/src/Action/ViewEntityAction.php index da2bf386..c80f5eb7 100644 --- a/src/Action/ViewEntityAction.php +++ b/src/Action/ViewEntityAction.php @@ -20,8 +20,8 @@ final class ViewEntityAction { public function __construct( - private Environment $twig, - private AuditReader $auditReader, + private readonly Environment $twig, + private readonly AuditReader $auditReader, ) { } diff --git a/src/Action/ViewRevisionAction.php b/src/Action/ViewRevisionAction.php index a9102e97..5f4c168c 100644 --- a/src/Action/ViewRevisionAction.php +++ b/src/Action/ViewRevisionAction.php @@ -22,8 +22,8 @@ final class ViewRevisionAction { public function __construct( - private Environment $twig, - private AuditReader $auditReader, + private readonly Environment $twig, + private readonly AuditReader $auditReader, ) { } diff --git a/src/AuditManager.php b/src/AuditManager.php index 98b88f33..0acf0a33 100644 --- a/src/AuditManager.php +++ b/src/AuditManager.php @@ -26,11 +26,11 @@ */ class AuditManager { - private MetadataFactory $metadataFactory; + private readonly MetadataFactory $metadataFactory; public function __construct( - private AuditConfiguration $config, - private ?ClockInterface $clock = null, + private readonly AuditConfiguration $config, + private readonly ?ClockInterface $clock = null, ) { $this->metadataFactory = $config->createMetadataFactory(); } diff --git a/src/ChangedEntity.php b/src/ChangedEntity.php index f48e04ba..a5061ac3 100644 --- a/src/ChangedEntity.php +++ b/src/ChangedEntity.php @@ -25,10 +25,10 @@ class ChangedEntity * @phpstan-param T $entity */ public function __construct( - private string $className, - private array $id, - private string $revType, - private object $entity, + private readonly string $className, + private readonly array $id, + private readonly string $revType, + private readonly object $entity, ) { } diff --git a/src/DeferredChangedManyToManyEntityRevisionToPersist.php b/src/DeferredChangedManyToManyEntityRevisionToPersist.php index 56eac1cc..5e4f008a 100644 --- a/src/DeferredChangedManyToManyEntityRevisionToPersist.php +++ b/src/DeferredChangedManyToManyEntityRevisionToPersist.php @@ -28,12 +28,12 @@ final class DeferredChangedManyToManyEntityRevisionToPersist * @param ClassMetadata $targetClass */ public function __construct( - private object $entity, - private string $revType, - private array $entityData, - private array|ManyToManyOwningSideMapping $assoc, - private ClassMetadata $class, - private ClassMetadata $targetClass, + private readonly object $entity, + private readonly string $revType, + private readonly array $entityData, + private readonly array|ManyToManyOwningSideMapping $assoc, + private readonly ClassMetadata $class, + private readonly ClassMetadata $targetClass, ) { } diff --git a/src/EventListener/CacheListener.php b/src/EventListener/CacheListener.php index ff0b218d..5745db3f 100644 --- a/src/EventListener/CacheListener.php +++ b/src/EventListener/CacheListener.php @@ -22,7 +22,7 @@ */ final class CacheListener implements EventSubscriber { - public function __construct(private AuditReader $auditReader) + public function __construct(private readonly AuditReader $auditReader) { } diff --git a/src/Revision.php b/src/Revision.php index ad42d3e9..eda368a5 100644 --- a/src/Revision.php +++ b/src/Revision.php @@ -23,8 +23,8 @@ class Revision */ public function __construct( private $rev, - private \DateTime $timestamp, - private ?string $username, + private readonly \DateTime $timestamp, + private readonly ?string $username, ) { } diff --git a/tests/ClockTest.php b/tests/ClockTest.php index 22cb02e6..3e6feebc 100644 --- a/tests/ClockTest.php +++ b/tests/ClockTest.php @@ -50,7 +50,7 @@ public function testFixedClockIsUsed(): void protected function getClock(): ClockInterface { return new class($this->getFixedTime()) implements ClockInterface { - public function __construct(private \DateTimeImmutable $now) + public function __construct(private readonly \DateTimeImmutable $now) { }