Skip to content

Commit 72670be

Browse files
nicolas-grekasfabpot
authored andcommitted
Bump minimum version of PHP to 8.1
1 parent e0605ec commit 72670be

File tree

7 files changed

+4
-19
lines changed

7 files changed

+4
-19
lines changed

Form/Type/DoctrineType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function configureOptions(OptionsResolver $resolver)
156156
$choiceValue = function (Options $options) {
157157
// If the entity has a single-column ID, use that ID as value
158158
if ($options['id_reader'] instanceof IdReader && $options['id_reader']->isSingleId()) {
159-
return ChoiceList::value($this, [$options['id_reader'], 'getIdValue'], $options['id_reader']);
159+
return ChoiceList::value($this, $options['id_reader']->getIdValue(...), $options['id_reader']);
160160
}
161161

162162
// Otherwise, an incrementing integer is used as value automatically

Form/Type/EntityType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function getQueryBuilderPartsForCachingHash(object $queryBuilder): ?array
8282

8383
return [
8484
$queryBuilder->getQuery()->getSQL(),
85-
array_map([$this, 'parameterToArray'], $queryBuilder->getParameters()->toArray()),
85+
array_map($this->parameterToArray(...), $queryBuilder->getParameters()->toArray()),
8686
];
8787
}
8888

Tests/DependencyInjection/DoctrineExtensionTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ public function testFixManagersAutoMappingsWithTwoAutomappings()
7979

8080
$reflection = new \ReflectionClass(\get_class($this->extension));
8181
$method = $reflection->getMethod('fixManagersAutoMappings');
82-
$method->setAccessible(true);
8382

8483
$method->invoke($this->extension, $emConfigs, $bundles);
8584
}
@@ -168,7 +167,6 @@ public function testFixManagersAutoMappings(array $originalEm1, array $originalE
168167

169168
$reflection = new \ReflectionClass(\get_class($this->extension));
170169
$method = $reflection->getMethod('fixManagersAutoMappings');
171-
$method->setAccessible(true);
172170

173171
$newEmConfigs = $method->invoke($this->extension, $emConfigs, $bundles);
174172

@@ -186,7 +184,6 @@ public function testMappingTypeDetection()
186184

187185
$reflection = new \ReflectionClass(\get_class($this->extension));
188186
$method = $reflection->getMethod('detectMappingType');
189-
$method->setAccessible(true);
190187

191188
// The ordinary fixtures contain annotation
192189
$mappingType = $method->invoke($this->extension, __DIR__.'/../Fixtures', $container);
@@ -329,7 +326,6 @@ public function testBundleAutoMapping(string $bundle, string $expectedType, stri
329326

330327
$reflection = new \ReflectionClass(\get_class($this->extension));
331328
$method = $reflection->getMethod('getMappingDriverBundleConfigDefaults');
332-
$method->setAccessible(true);
333329

334330
$this->assertSame(
335331
[
@@ -347,8 +343,6 @@ protected function invokeLoadCacheDriver(array $objectManager, ContainerBuilder
347343
{
348344
$method = new \ReflectionMethod($this->extension, 'loadObjectManagerCacheDriver');
349345

350-
$method->setAccessible(true);
351-
352346
$method->invokeArgs($this->extension, [$objectManager, $container, $cacheName]);
353347
}
354348

Tests/Form/Type/EntityTypeTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,10 +1310,7 @@ public function testLoaderCachingWithParameters()
13101310
$this->assertSame($choiceList1, $choiceList3);
13111311
}
13121312

1313-
/**
1314-
* @return MockObject&ManagerRegistry
1315-
*/
1316-
protected function createRegistryMock($name, $em): ManagerRegistry
1313+
protected function createRegistryMock($name, $em): MockObject&ManagerRegistry
13171314
{
13181315
$registry = $this->createMock(ManagerRegistry::class);
13191316
$registry->expects($this->any())

Tests/PropertyInfo/DoctrineExtractorTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ public function testExtractWithEmbedded()
128128
$this->assertEquals($expectedTypes, $actualTypes);
129129
}
130130

131-
/**
132-
* @requires PHP 8.1
133-
*/
134131
public function testExtractEnum()
135132
{
136133
if (!property_exists(Column::class, 'enumType')) {

Tests/Validator/DoctrineLoaderTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,6 @@ public function testLoadClassMetadata()
151151
$this->assertSame(AutoMappingStrategy::DISABLED, $noAutoMappingMetadata[0]->getAutoMappingStrategy());
152152
}
153153

154-
/**
155-
* @requires PHP 8.1
156-
*/
157154
public function testExtractEnum()
158155
{
159156
if (!property_exists(Column::class, 'enumType')) {

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": ">=8.0.2",
19+
"php": ">=8.1",
2020
"doctrine/event-manager": "~1.0",
2121
"doctrine/persistence": "^2",
2222
"symfony/deprecation-contracts": "^2.1|^3",

0 commit comments

Comments
 (0)