Skip to content

Commit caff067

Browse files
Allow symfony 7 (#12)
Allow symfony 7
1 parent eb888e9 commit caff067

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,23 @@ jobs:
88
strategy:
99
max-parallel: 10
1010
matrix:
11-
php: [ '7.2', '7.3', '7.4', '8.0' ]
12-
sf_version: [ '3.4.*', '4.4.*', '5.3.*' ]
11+
versions:
12+
- sf: '6.4.*'
13+
php: '8.1'
14+
- sf: '6.4.*'
15+
php: '8.2'
16+
- sf: '6.4.*'
17+
php: '8.3'
18+
- sf: '7.1.*'
19+
php: '8.2'
20+
- sf: '7.1.*'
21+
php: '8.3'
1322

1423
steps:
1524
- name: Set up PHP
1625
uses: shivammathur/[email protected]
1726
with:
18-
php-version: ${{ matrix.php }}
27+
php-version: ${{ matrix.versions.php }}
1928
coverage: none
2029
tools: flex
2130

@@ -24,7 +33,7 @@ jobs:
2433

2534
- name: Download dependencies
2635
env:
27-
SYMFONY_REQUIRE: ${{ matrix.sf_version }}
36+
SYMFONY_REQUIRE: ${{ matrix.versions.sf }}
2837
uses: ramsey/composer-install@v1
2938

3039
- name: Run tests
@@ -37,7 +46,7 @@ jobs:
3746
- name: Set up PHP
3847
uses: shivammathur/[email protected]
3948
with:
40-
php-version: 7.3
49+
php-version: 8.3
4150
coverage: none
4251

4352
- name: Checkout code

.github/workflows/static.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Setup PHP
1414
uses: shivammathur/setup-php@v2
1515
with:
16-
php-version: 8.0
16+
php-version: 8.3
1717
coverage: none
1818
tools: phpstan:0.12.92, cs2pr
1919

@@ -51,7 +51,7 @@ jobs:
5151
- name: Setup PHP
5252
uses: shivammathur/setup-php@v2
5353
with:
54-
php-version: 8.0
54+
php-version: 8.3
5555
coverage: none
5656
tools: vimeo/psalm:4.8.1
5757

@@ -69,7 +69,7 @@ jobs:
6969
- name: Setup PHP
7070
uses: shivammathur/setup-php@v2
7171
with:
72-
php-version: 8.0
72+
php-version: 8.3
7373
coverage: none
7474
tools: composer-normalize
7575

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
}
1515
],
1616
"require": {
17-
"php": "^7.2 || ^8.0",
17+
"php": "^8.1",
1818
"doctrine/orm": "^2.4",
19-
"symfony/validator": "^3.4 || ^4.4 || ^5.0 || ^6.0"
19+
"symfony/validator": "^6.0 || ^7.0"
2020
},
2121
"require-dev": {
22-
"symfony/phpunit-bridge": "^5.3"
22+
"symfony/phpunit-bridge": "^6.0",
23+
"symfony/validator": "^6.4 || ^7.0"
2324
},
2425
"autoload": {
2526
"psr-4": {

tests/EntityExistValidatorTest.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Symfony\Component\Validator\Constraints\NotNull;
1414
use Symfony\Component\Validator\Context\ExecutionContextInterface;
1515
use Symfony\Component\Validator\Mapping\ClassMetadata;
16-
use Symfony\Component\Validator\Mapping\Loader\AnnotationLoader;
16+
use Symfony\Component\Validator\Mapping\Loader\AttributeLoader;
1717
use Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface;
1818

1919
class EntityExistValidatorTest extends TestCase
@@ -166,15 +166,10 @@ public function testValidateInvalidEntity(): void
166166
*/
167167
public function testValidateFromAttribute()
168168
{
169-
$numRequired = (new \ReflectionMethod(AnnotationLoader::class, '__construct'))->getNumberOfRequiredParameters();
170-
if ($numRequired > 0) {
171-
$this->markTestSkipped('This test is skipped on Symfony <5.2');
172-
}
173-
174169
$this->context->expects($this->never())->method('buildViolation');
175170

176171
$classMetadata = new ClassMetadata(EntityDummy::class);
177-
(new AnnotationLoader())->loadClassMetadata($classMetadata);
172+
(new AttributeLoader())->loadClassMetadata($classMetadata);
178173

179174
[$constraint] = $classMetadata->properties['user']->constraints;
180175

0 commit comments

Comments
 (0)