From b215feec48373ff36f28629e47c4d4b29cc88fc2 Mon Sep 17 00:00:00 2001 From: Thomas Beaujean Date: Mon, 12 Feb 2024 22:04:27 +0100 Subject: [PATCH] Allow symfony 7 Allow symfony 7 --- .github/workflows/ci.yml | 19 ++++++++++++++----- .github/workflows/static.yml | 8 ++++---- composer.json | 6 +++--- tests/EntityExistValidatorTest.php | 9 ++------- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f614ee3..50eda3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,14 +8,23 @@ jobs: strategy: max-parallel: 10 matrix: - php: [ '7.2', '7.3', '7.4', '8.0' ] - sf_version: [ '3.4.*', '4.4.*', '5.3.*' ] + versions: + - sf: '6.4.*' + php: '8.1' + - sf: '6.4.*' + php: '8.2' + - sf: '6.4.*' + php: '8.3' + - sf: '7.1.*' + php: '8.2' + - sf: '7.1.*' + php: '8.3' steps: - name: Set up PHP uses: shivammathur/setup-php@2.7.0 with: - php-version: ${{ matrix.php }} + php-version: ${{ matrix.versions.php }} coverage: none tools: flex @@ -24,7 +33,7 @@ jobs: - name: Download dependencies env: - SYMFONY_REQUIRE: ${{ matrix.sf_version }} + SYMFONY_REQUIRE: ${{ matrix.versions.sf }} uses: ramsey/composer-install@v1 - name: Run tests @@ -37,7 +46,7 @@ jobs: - name: Set up PHP uses: shivammathur/setup-php@2.5.0 with: - php-version: 7.3 + php-version: 8.3 coverage: none - name: Checkout code diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 7d8b221..62fdadf 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -13,7 +13,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: 8.3 coverage: none tools: phpstan:0.12.92, cs2pr @@ -34,7 +34,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: 8.3 coverage: none tools: php-cs-fixer:2.19.0, cs2pr @@ -51,7 +51,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: 8.3 coverage: none tools: vimeo/psalm:4.8.1 @@ -69,7 +69,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: 8.3 coverage: none tools: composer-normalize diff --git a/composer.json b/composer.json index 7d437e6..9f74115 100644 --- a/composer.json +++ b/composer.json @@ -14,12 +14,12 @@ } ], "require": { - "php": "^7.2 || ^8.0", + "php": "^8.1", "doctrine/orm": "^2.4", - "symfony/validator": "^3.4 || ^4.4 || ^5.0 || ^6.0" + "symfony/validator": "^6.0 || ^7.0" }, "require-dev": { - "symfony/phpunit-bridge": "^5.3" + "symfony/phpunit-bridge": "^6.0" }, "autoload": { "psr-4": { diff --git a/tests/EntityExistValidatorTest.php b/tests/EntityExistValidatorTest.php index 1e951cd..df38e05 100644 --- a/tests/EntityExistValidatorTest.php +++ b/tests/EntityExistValidatorTest.php @@ -13,7 +13,7 @@ use Symfony\Component\Validator\Constraints\NotNull; use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Mapping\ClassMetadata; -use Symfony\Component\Validator\Mapping\Loader\AnnotationLoader; +use Symfony\Component\Validator\Mapping\Loader\AttributeLoader; use Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface; class EntityExistValidatorTest extends TestCase @@ -166,15 +166,10 @@ public function testValidateInvalidEntity(): void */ public function testValidateFromAttribute() { - $numRequired = (new \ReflectionMethod(AnnotationLoader::class, '__construct'))->getNumberOfRequiredParameters(); - if ($numRequired > 0) { - $this->markTestSkipped('This test is skipped on Symfony <5.2'); - } - $this->context->expects($this->never())->method('buildViolation'); $classMetadata = new ClassMetadata(EntityDummy::class); - (new AnnotationLoader())->loadClassMetadata($classMetadata); + (new AttributeLoader())->loadClassMetadata($classMetadata); [$constraint] = $classMetadata->properties['user']->constraints;