diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 15ea900..d2078cb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,11 +14,12 @@ jobs: fail-fast: false matrix: include: - - { php-version: 8.1, symfony-locked-version: none, dependency-version: prefer-lowest } - - { php-version: 8.1, symfony-locked-version: 6.4.*, dependency-version: prefer-stable } - - { php-version: 8.2, symfony-locked-version: none, dependency-version: prefer-stable } - - { php-version: 8.3, symfony-locked-version: none, dependency-version: prefer-stable } - name: PHPUnit (PHP ${{matrix.php-version}}, Symfony Version Lock ${{ matrix.symfony-locked-version }}, ${{ matrix.dependency-version }}) + - { php-version: 8.1, symfony-locked-version: none, orm-version: none, dependency-version: prefer-lowest } + - { php-version: 8.1, symfony-locked-version: 6.4.*, orm-version: '^2.18', dependency-version: prefer-stable } + - { php-version: 8.1, symfony-locked-version: 6.4.*, orm-version: none, dependency-version: prefer-stable } + - { php-version: 8.2, symfony-locked-version: none, orm-version: '^2.18', dependency-version: prefer-stable } + - { php-version: 8.3, symfony-locked-version: none, orm-version: none, dependency-version: prefer-stable } + name: PHPUnit (PHP ${{matrix.php-version}}, Symfony Version Lock ${{ matrix.symfony-locked-version }}, ORM Version ${{matrix.orm-version }}, ${{ matrix.dependency-version }}) steps: - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 @@ -34,6 +35,8 @@ jobs: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ matrix.symfony-locked-version }}-${{ matrix.dependency-version }}- - run: VERSION=${{ matrix.symfony-locked-version }} .github/workflows/lock-symfony-version.sh if: matrix.symfony-locked-version != 'none' + - run: composer require --no-update --no-interaction --no-scripts --no-progress --ansi doctrine/orm '${{ matrix.orm-version}}' + if: matrix.orm-version != 'none' - run: composer update --${{ matrix.dependency-version }} --no-interaction --no-scripts --no-progress --ansi - run: composer show - run: vendor/bin/phpunit diff --git a/composer.json b/composer.json index e52e1b7..10d927b 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "doctrine/collections": "^1.0|^2.0", "doctrine/dbal": "^2.3|^3.0", "doctrine/event-manager": "^1.0|^2.0", - "doctrine/orm": "^2.13", + "doctrine/orm": "^2.19|^3.0", "doctrine/persistence": "^1.3.8|^2.1|^3.1", "psr/log": "^1.0|^2.0|^3.0", "symfony/config": "^5.4|^6.4|^7.0", diff --git a/src/Doctrine/TranslatableClassMetadata.php b/src/Doctrine/TranslatableClassMetadata.php index f524063..fcdaa40 100644 --- a/src/Doctrine/TranslatableClassMetadata.php +++ b/src/Doctrine/TranslatableClassMetadata.php @@ -11,7 +11,7 @@ use Doctrine\ORM\EntityManager; use Doctrine\ORM\Mapping\ClassMetadataFactory; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\Persistence\Mapping\RuntimeReflectionService; use Psr\Log\LoggerInterface; use ReflectionClass; @@ -84,7 +84,7 @@ private function __construct( public static function parseFromClass(string $class, ClassMetadataFactory $classMetadataFactory): ?self { - /** @var ClassMetadataInfo $cm */ + /** @var ClassMetadata $cm */ $cm = $classMetadataFactory->getMetadataFor($class); $tm = new static($class); @@ -179,7 +179,7 @@ private function assertAttributesAreComplete(string $class): void } } - private function findTranslatedProperties(ClassMetadataInfo $cm, ClassMetadataFactory $classMetadataFactory): void + private function findTranslatedProperties(ClassMetadata $cm, ClassMetadataFactory $classMetadataFactory): void { if (!$this->translationClass) { return; @@ -209,7 +209,7 @@ private function findTranslatedProperties(ClassMetadataInfo $cm, ClassMetadataFa } } - private function findTranslationsCollection(ClassMetadataInfo $cm, ClassMetadataFactory $classMetadataFactory): void + private function findTranslationsCollection(ClassMetadata $cm, ClassMetadataFactory $classMetadataFactory): void { foreach ($cm->associationMappings as $fieldName => $mapping) { if (isset($mapping['declared'])) { @@ -232,7 +232,7 @@ private function findTranslationsCollection(ClassMetadataInfo $cm, ClassMetadata } } - private function findPrimaryLocale(ClassMetadataInfo $cm): void + private function findPrimaryLocale(ClassMetadata $cm): void { foreach (array_merge([$cm->name], $cm->parentClasses) as $class) { $reflectionClass = new ReflectionClass($class); @@ -245,7 +245,7 @@ private function findPrimaryLocale(ClassMetadataInfo $cm): void } } - private function parseTranslationsEntity(ClassMetadataInfo $cm): void + private function parseTranslationsEntity(ClassMetadata $cm): void { foreach ($cm->fieldMappings as $fieldName => $mapping) { $reflectionProperty = $cm->getReflectionProperty($fieldName);