Skip to content

Commit 2f3f538

Browse files
nicolas-grekasfabpot
authored andcommitted
Bump minimum version of PHP to 8.1
1 parent 3d2fe3e commit 2f3f538

15 files changed

+14
-40
lines changed

Command/ConfigDebugCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ private function compileContainer(): ContainerBuilder
127127
$kernel->boot();
128128

129129
$method = new \ReflectionMethod($kernel, 'buildContainer');
130-
$method->setAccessible(true);
131130
$container = $method->invoke($kernel);
132131
$container->getCompiler()->compile($container);
133132

Command/ContainerDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
132132
$options = ['env-vars' => true, 'name' => $envVar];
133133
} elseif ($input->getOption('types')) {
134134
$options = [];
135-
$options['filter'] = [$this, 'filterToServiceTypes'];
135+
$options['filter'] = $this->filterToServiceTypes(...);
136136
} elseif ($input->getOption('parameters')) {
137137
$parameters = [];
138138
foreach ($object->getParameterBag()->all() as $k => $v) {

Command/ContainerLintCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ private function getContainerBuilder(): ContainerBuilder
104104
(new XmlFileLoader($container = new ContainerBuilder($parameterBag = new EnvPlaceholderParameterBag()), new FileLocator()))->load($kernelContainer->getParameter('debug.container.dump'));
105105

106106
$refl = new \ReflectionProperty($parameterBag, 'resolved');
107-
$refl->setAccessible(true);
108107
$refl->setValue($parameterBag, true);
109108

110109
$skippedIds = [];

Command/DebugAutowiringCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7878

7979
$builder = $this->getContainerBuilder($this->getApplication()->getKernel());
8080
$serviceIds = $builder->getServiceIds();
81-
$serviceIds = array_filter($serviceIds, [$this, 'filterToServiceTypes']);
81+
$serviceIds = array_filter($serviceIds, $this->filterToServiceTypes(...));
8282

8383
if ($search = $input->getArgument('search')) {
8484
$searchNormalized = preg_replace('/[^a-zA-Z0-9\x7f-\xff $]++/', '', $search);
@@ -169,7 +169,7 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti
169169
if ($input->mustSuggestArgumentValuesFor('search')) {
170170
$builder = $this->getContainerBuilder($this->getApplication()->getKernel());
171171

172-
$suggestions->suggestValues(array_filter($builder->getServiceIds(), [$this, 'filterToServiceTypes']));
172+
$suggestions->suggestValues(array_filter($builder->getServiceIds(), $this->filterToServiceTypes(...)));
173173
}
174174
}
175175
}

Console/Descriptor/Descriptor.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ private function getContainerEnvVars(ContainerBuilder $container): array
326326
$getDefaultParameter = $getDefaultParameter->bindTo($bag, \get_class($bag));
327327

328328
$getEnvReflection = new \ReflectionMethod($container, 'getEnv');
329-
$getEnvReflection->setAccessible(true);
330329

331330
$envs = [];
332331

DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public function load(array $configs, ContainerBuilder $container)
248248

249249
$loader->load('web.php');
250250

251-
if (\PHP_VERSION_ID < 80100 || !class_exists(BackedEnumValueResolver::class)) {
251+
if (!class_exists(BackedEnumValueResolver::class)) {
252252
$container->removeDefinition('argument_resolver.backed_enum_resolver');
253253
}
254254

Routing/Router.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ public function __construct(ContainerInterface $container, mixed $resource, arra
4949
$this->setOptions($options);
5050

5151
if ($parameters) {
52-
$this->paramFetcher = \Closure::fromCallable([$parameters, 'get']);
52+
$this->paramFetcher = $parameters->get(...);
5353
} elseif ($container instanceof SymfonyContainerInterface) {
54-
$this->paramFetcher = \Closure::fromCallable([$container, 'getParameter']);
54+
$this->paramFetcher = $container->getParameter(...);
5555
} else {
5656
throw new \LogicException(sprintf('You should either pass a "%s" instance or provide the $parameters argument of the "%s" method.', SymfonyContainerInterface::class, __METHOD__));
5757
}

Tests/CacheWarmer/AnnotationsCacheWarmerTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,7 @@ public function testWarmupRemoveCacheMisses()
151151
$this->assertTrue(isset($data[0]['bar_hit']));
152152
}
153153

154-
/**
155-
* @return MockObject&Reader
156-
*/
157-
private function getReadOnlyReader(): Reader
154+
private function getReadOnlyReader(): MockObject&Reader
158155
{
159156
$readerMock = $this->createMock(Reader::class);
160157
$readerMock->expects($this->exactly(0))->method('getClassAnnotations');

Tests/Command/CachePoolClearCommandTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ public function provideCompletionSuggestions()
5252
];
5353
}
5454

55-
/**
56-
* @return MockObject&KernelInterface
57-
*/
58-
private function getKernel(): KernelInterface
55+
private function getKernel(): MockObject&KernelInterface
5956
{
6057
$container = $this->createMock(ContainerInterface::class);
6158

Tests/Command/CachePoolDeleteCommandTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,7 @@ public function provideCompletionSuggestions()
106106
];
107107
}
108108

109-
/**
110-
* @return MockObject&KernelInterface
111-
*/
112-
private function getKernel(): KernelInterface
109+
private function getKernel(): MockObject&KernelInterface
113110
{
114111
$container = $this->createMock(ContainerInterface::class);
115112

0 commit comments

Comments
 (0)