From 62e4b4e0f1511af1db20ff6689c9582d40bee23d Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Sat, 20 Dec 2025 11:45:57 +0100 Subject: [PATCH 1/2] chore: fix deprecations --- tests/Command/GeocodeCommandTest.php | 2 +- .../DependencyInjection/Compiler/FactoryValidatorPassTest.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/Command/GeocodeCommandTest.php b/tests/Command/GeocodeCommandTest.php index 203ef8e..aca7ad9 100644 --- a/tests/Command/GeocodeCommandTest.php +++ b/tests/Command/GeocodeCommandTest.php @@ -66,7 +66,7 @@ public function testExecute(): void ->willReturn([]); $app = new Application($kernel); - $app->add((new GeocodeCommand($geocoder))->setName('geocoder:geocode')); + $app->addCommand((new GeocodeCommand($geocoder))->setName('geocoder:geocode')); $command = $app->find('geocoder:geocode'); diff --git a/tests/DependencyInjection/Compiler/FactoryValidatorPassTest.php b/tests/DependencyInjection/Compiler/FactoryValidatorPassTest.php index 0b7f3f7..b6c43b7 100644 --- a/tests/DependencyInjection/Compiler/FactoryValidatorPassTest.php +++ b/tests/DependencyInjection/Compiler/FactoryValidatorPassTest.php @@ -33,7 +33,9 @@ protected function tearDown(): void { $reflection = new \ReflectionObject($this->compilerPass); $prop = $reflection->getProperty('factoryServiceIds'); - $prop->setAccessible(true); + if (PHP_VERSION_ID < 80100) { + $prop->setAccessible(true); + } $prop->setValue(null, []); } From f17c0faee26d4943d3bfc62cec1efc42e2a410bf Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Sat, 20 Dec 2025 11:55:48 +0100 Subject: [PATCH 2/2] chore: fix deprecations --- tests/Command/GeocodeCommandTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/Command/GeocodeCommandTest.php b/tests/Command/GeocodeCommandTest.php index aca7ad9..dafb43d 100644 --- a/tests/Command/GeocodeCommandTest.php +++ b/tests/Command/GeocodeCommandTest.php @@ -66,7 +66,12 @@ public function testExecute(): void ->willReturn([]); $app = new Application($kernel); - $app->addCommand((new GeocodeCommand($geocoder))->setName('geocoder:geocode')); + if (method_exists($app, 'addCommand')) { + // since Symfony 8 + $app->addCommand((new GeocodeCommand($geocoder))->setName('geocoder:geocode')); + } else { + $app->add(new GeocodeCommand($geocoder)); + } $command = $app->find('geocoder:geocode');