From df5cc16df47f142a5a93dc235fe53ec22d620eab Mon Sep 17 00:00:00 2001 From: Lukasz Cybula Date: Thu, 8 Jan 2026 12:09:30 +0100 Subject: [PATCH 1/4] Test on PHP 8.5 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd4376f..9ef0497 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: test: strategy: matrix: - php-version: [8.1, 8.2, 8.3, 8.4] + php-version: [8.1, 8.2, 8.3, 8.4, 8.5] runs-on: ubuntu-22.04 container: image: fsiopenpl/docker-php-apache:alpine-${{ matrix.php-version }} From 20c87ec2c83f8858c7ffb424743be5c63ecc1a14 Mon Sep 17 00:00:00 2001 From: Lukasz Cybula Date: Fri, 9 Jan 2026 12:48:02 +0100 Subject: [PATCH 2/4] Test on Symfony 7.* --- composer.json | 38 ++++++++++--------- .../Symfony/TranslatableBundle.php | 2 +- src/PropertyConfiguration.php | 6 ++- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/composer.json b/composer.json index db26cbb..7a630f9 100644 --- a/composer.json +++ b/composer.json @@ -47,28 +47,30 @@ "phpunit/phpunit": "^9.5", "psr/http-client": "^1.0", "squizlabs/php_codesniffer": "^3.7", - "symfony/asset": "^4.4.30|^5.4|^6.0", - "symfony/clock": "^6.4", - "symfony/config": "^4.4.30|^5.4|^6.0", - "symfony/console": "^4.4.30|^5.4|^6.0", - "symfony/dependency-injection": "^4.4.30|^5.4|^6.0", - "symfony/finder": "^4.4.30|^5.4|^6.0", - "symfony/form": "^4.4.30|^5.4|^6.0", - "symfony/framework-bundle": "^4.4.30|^5.4|^6.0", - "symfony/http-client": "^4.4.30|^5.4|^6.0", - "symfony/http-foundation": "^4.4.30|^5.4|^6.0", - "symfony/http-kernel": "^4.4.30|^5.4|^6.0", - "symfony/mime": "^4.4.30|^5.4|^6.0", + "symfony/asset": "^4.4.30|^5.4|^6.0|^7.0", + "symfony/clock": "^6.4|^7.0", + "symfony/config": "^4.4.30|^5.4|^6.0|^7.0", + "symfony/console": "^4.4.30|^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^4.4.30|^5.4|^6.0|^7.0", + "symfony/finder": "^4.4.30|^5.4|^6.0|^7.0", + "symfony/form": "^4.4.30|^5.4|^6.0|^7.0", + "symfony/framework-bundle": "^4.4.30|^5.4|^6.0|^7.0", + "symfony/http-client": "^4.4.30|^5.4|^6.0|^7.0", + "symfony/http-foundation": "^4.4.30|^5.4|^6.0|^7.0", + "symfony/http-kernel": "^4.4.30|^5.4|^6.0|^7.0", + "symfony/mime": "^4.4.30|^5.4|^6.0|^7.0", "symfony/monolog-bundle": "^3.7", - "symfony/property-access": "^5.4|^6.3", - "symfony/routing": "^4.4.30|^5.4|^6.0", - "symfony/translation": "^4.4.30|^5.4|^6.0", - "symfony/twig-bundle": "^4.4.30|^5.4|^6.0", - "symfony/validator": "^4.4.30|^5.4|^6.0", + "symfony/property-access": "^5.4|^6.3|^7.0", + "symfony/routing": "^4.4.30|^5.4|^6.0|^7.0", + "symfony/translation": "^4.4.30|^5.4|^6.0|^7.0", + "symfony/twig-bundle": "^4.4.30|^5.4|^6.0|^7.0", + "symfony/validator": "^4.4.30|^5.4|^6.0|^7.0", + "symfony/var-exporter": "^5.4|^6.0|^7.0", "twig/twig": "^3.7" }, "conflict": { - "doctrine/persistence": "<2.0" + "doctrine/persistence": "<2.0", + "symfony/property-info": ">=8.0" }, "scripts": { "sniffer": "vendor/bin/phpcs", diff --git a/src/Integration/Symfony/TranslatableBundle.php b/src/Integration/Symfony/TranslatableBundle.php index dd472dd..c51f686 100644 --- a/src/Integration/Symfony/TranslatableBundle.php +++ b/src/Integration/Symfony/TranslatableBundle.php @@ -36,7 +36,7 @@ public function build(ContainerBuilder $container): void public function getContainerExtension(): ?ExtensionInterface { - if (null === $this->extension) { + if (false === $this->extension instanceof TranslatableExtension) { $this->extension = new TranslatableExtension(); } diff --git a/src/PropertyConfiguration.php b/src/PropertyConfiguration.php index 7748786..7c98c8b 100644 --- a/src/PropertyConfiguration.php +++ b/src/PropertyConfiguration.php @@ -26,6 +26,8 @@ use function method_exists; use function property_exists; +use const PHP_VERSION_ID; + final class PropertyConfiguration { /** @@ -119,7 +121,9 @@ private function getPropertyReflection(): ReflectionProperty } $this->propertyReflection = $reflectionClass->getProperty($this->propertyName); - $this->propertyReflection->setAccessible(true); + if (PHP_VERSION_ID < 80500) { + $this->propertyReflection->setAccessible(true); + } } while ($reflectionClass = $reflectionClass->getParentClass()); } From 1108ad672244ed60ad485f157af2fd1b019529bf Mon Sep 17 00:00:00 2001 From: Lukasz Cybula Date: Mon, 12 Jan 2026 15:55:27 +0100 Subject: [PATCH 3/4] Stable fsi/files dependency --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7a630f9..d75c744 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "doctrine/lexer": "^1.2|^2.0|^3.0", "doctrine/orm": "^2.13|^3.0", "doctrine/persistence": "^2.0|^3.0", - "fsi/files": "^2.0.4|^3.0@dev", + "fsi/files": "^2.0.4|^3.0", "guzzlehttp/psr7": "^2.0", "monolog/monolog": "^1.25", "nyholm/psr7": "^1.4", From 80f3430326a28575933185f80c256c354abd09d8 Mon Sep 17 00:00:00 2001 From: Lukasz Cybula Date: Mon, 12 Jan 2026 15:55:59 +0100 Subject: [PATCH 4/4] Convert doctrine event subscriber to event listeners for symfony/doctrine-bridge >=7.0 compatibility --- .../Doctrine/ORM/Subscriber/EntitySubscriber.php | 12 +----------- .../Symfony/Resources/config/services/doctrine.xml | 5 ++++- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/Integration/Doctrine/ORM/Subscriber/EntitySubscriber.php b/src/Integration/Doctrine/ORM/Subscriber/EntitySubscriber.php index c3a0366..ce21fc4 100644 --- a/src/Integration/Doctrine/ORM/Subscriber/EntitySubscriber.php +++ b/src/Integration/Doctrine/ORM/Subscriber/EntitySubscriber.php @@ -12,11 +12,9 @@ namespace FSi\Component\Translatable\Integration\Doctrine\ORM\Subscriber; use Assert\Assertion; -use Doctrine\Common\EventSubscriber; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Event\OnFlushEventArgs; use Doctrine\ORM\Event\PreFlushEventArgs; -use Doctrine\ORM\Events; use Doctrine\Persistence\Event\LifecycleEventArgs; use Doctrine\Persistence\ObjectManager; use Doctrine\Persistence\Proxy; @@ -31,7 +29,7 @@ use function in_array; use function method_exists; -final class EntitySubscriber implements EventSubscriber +final class EntitySubscriber { private LocaleProvider $localeProvider; private ConfigurationResolver $entityConfigurationResolver; @@ -53,14 +51,6 @@ public function __construct( $this->translationCleaner = $translationCleaner; } - /** - * @return list - */ - public function getSubscribedEvents(): array - { - return [Events::postLoad, Events::preRemove, Events::preFlush, Events::onFlush]; - } - /** * @param LifecycleEventArgs $event */ diff --git a/src/Integration/Symfony/Resources/config/services/doctrine.xml b/src/Integration/Symfony/Resources/config/services/doctrine.xml index e98e530..4a21630 100644 --- a/src/Integration/Symfony/Resources/config/services/doctrine.xml +++ b/src/Integration/Symfony/Resources/config/services/doctrine.xml @@ -11,7 +11,10 @@ - + + + +