Skip to content

Commit cd1ab3c

Browse files
nicolas-grekasfabpot
authored andcommitted
Bump minimum version of PHP to 8.1
1 parent 37d555e commit cd1ab3c

File tree

8 files changed

+3
-18
lines changed

8 files changed

+3
-18
lines changed

Mapping/PropertyMetadata.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ protected function newReflectionMember(object|string $objectOrClassName): \Refle
8585
}
8686
}
8787

88-
$member = new \ReflectionProperty($objectOrClassName, $this->getName());
89-
$member->setAccessible(true);
90-
91-
return $member;
88+
return new \ReflectionProperty($objectOrClassName, $this->getName());
9289
}
9390
}

Tests/Constraints/FileValidatorTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,6 @@ public function uploadedFileErrorProvider()
498498
// access FileValidator::factorizeSizes() private method to format max file size
499499
$reflection = new \ReflectionClass(\get_class(new FileValidator()));
500500
$method = $reflection->getMethod('factorizeSizes');
501-
$method->setAccessible(true);
502501
[, $limit, $suffix] = $method->invokeArgs(new FileValidator(), [0, UploadedFile::getMaxFilesize(), false]);
503502

504503
// it correctly parses the maxSize option and not only uses simple string comparison

Tests/Constraints/NotCompromisedPasswordValidatorTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public function testEmptyStringIsValid()
6565
public function testInvalidPasswordButDisabled()
6666
{
6767
$r = new \ReflectionProperty($this->validator, 'enabled');
68-
$r->setAccessible(true);
6968
$r->setValue($this->validator, false);
7069

7170
$this->validator->validate(self::PASSWORD_LEAKED, new NotCompromisedPassword());

Tests/Mapping/GetterMetadataTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ public function testInvalidPropertyName()
2929

3030
public function testGetPropertyValueFromPublicGetter()
3131
{
32-
// private getters don't work yet because ReflectionMethod::setAccessible()
33-
// does not exist yet in a stable PHP release
34-
3532
$entity = new Entity('foobar');
3633
$metadata = new GetterMetadata(self::CLASSNAME, 'internal');
3734

Tests/Mapping/Loader/AnnotationLoaderTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,6 @@ public function provideNamespaces(): iterable
215215
{
216216
yield 'annotations' => ['Symfony\Component\Validator\Tests\Fixtures\Annotation'];
217217
yield 'attributes' => ['Symfony\Component\Validator\Tests\Fixtures\Attribute'];
218-
219-
if (\PHP_VERSION_ID >= 80100) {
220-
yield 'nested_attributes' => ['Symfony\Component\Validator\Tests\Fixtures\NestedAttribute'];
221-
}
218+
yield 'nested_attributes' => ['Symfony\Component\Validator\Tests\Fixtures\NestedAttribute'];
222219
}
223220
}

Tests/Mapping/Loader/YamlFileLoaderTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public function testLoadClassMetadataReturnsFalseIfEmpty()
3636
$this->assertFalse($loader->loadClassMetadata($metadata));
3737

3838
$r = new \ReflectionProperty($loader, 'classes');
39-
$r->setAccessible(true);
4039
$this->assertSame([], $r->getValue($loader));
4140
}
4241

Tests/ValidatorBuilderTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public function testEnableAnnotationMappingWithDefaultDoctrineAnnotationReader()
9191
$this->assertInstanceOf(AnnotationLoader::class, $loaders[0]);
9292

9393
$r = new \ReflectionProperty(AnnotationLoader::class, 'reader');
94-
$r->setAccessible(true);
9594

9695
$this->assertInstanceOf(PsrCachedReader::class, $r->getValue($loaders[0]));
9796
}
@@ -108,7 +107,6 @@ public function testEnableAnnotationMappingWithCustomDoctrineAnnotationReader()
108107
$this->assertInstanceOf(AnnotationLoader::class, $loaders[0]);
109108

110109
$r = new \ReflectionProperty(AnnotationLoader::class, 'reader');
111-
$r->setAccessible(true);
112110

113111
$this->assertSame($reader, $r->getValue($loaders[0]));
114112
}

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@
1616
}
1717
],
1818
"require": {
19-
"php": ">=8.0.2",
19+
"php": ">=8.1",
2020
"symfony/deprecation-contracts": "^2.1|^3",
2121
"symfony/polyfill-ctype": "~1.8",
2222
"symfony/polyfill-mbstring": "~1.0",
23-
"symfony/polyfill-php81": "^1.22",
2423
"symfony/translation-contracts": "^1.1|^2|^3"
2524
},
2625
"require-dev": {

0 commit comments

Comments
 (0)