Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
40 changes: 21 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
12 changes: 1 addition & 11 deletions src/Integration/Doctrine/ORM/Subscriber/EntitySubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -53,14 +51,6 @@ public function __construct(
$this->translationCleaner = $translationCleaner;
}

/**
* @return list<string>
*/
public function getSubscribedEvents(): array
{
return [Events::postLoad, Events::preRemove, Events::preFlush, Events::onFlush];
}

/**
* @param LifecycleEventArgs<ObjectManager> $event
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
<argument type="service" id="FSi\Component\Translatable\Entity\TranslationLoader" />
<argument type="service" id="FSi\Component\Translatable\Entity\TranslationUpdater" />
<argument type="service" id="FSi\Component\Translatable\Entity\TranslationCleaner" />
<tag name="doctrine.event_subscriber" priority="100" />
<tag name="doctrine.event_listener" event="postLoad" priority="100" />
<tag name="doctrine.event_listener" event="preRemove" priority="100" />
<tag name="doctrine.event_listener" event="preFlush" priority="100" />
<tag name="doctrine.event_listener" event="onFlush" priority="100" />
</service>

<service id="FSi\Component\Translatable\Integration\Doctrine\ORM\TranslationManager">
Expand Down
2 changes: 1 addition & 1 deletion src/Integration/Symfony/TranslatableBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
6 changes: 5 additions & 1 deletion src/PropertyConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
use function method_exists;
use function property_exists;

use const PHP_VERSION_ID;

final class PropertyConfiguration
{
/**
Expand Down Expand Up @@ -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());
}

Expand Down