diff --git a/composer.json b/composer.json index 2c5b3d1e9..a72733308 100644 --- a/composer.json +++ b/composer.json @@ -34,12 +34,12 @@ "doctrine/deprecations": "^1.0", "doctrine/persistence": "^4", "doctrine/sql-formatter": "^1.0.1", - "symfony/cache": "^6.4 || ^7.0 || ^8.0", - "symfony/config": "^6.4 || ^7.0 || ^8.0", - "symfony/console": "^6.4 || ^7.0 || ^8.0", - "symfony/dependency-injection": "^6.4 || ^7.0 || ^8.0", - "symfony/doctrine-bridge": "^6.4.3 || ^7.0.3 || ^8.0", - "symfony/framework-bundle": "^6.4 || ^7.0 || ^8.0", + "symfony/cache": "^6.4 || ^7.0", + "symfony/config": "^6.4 || ^7.0", + "symfony/console": "^6.4 || ^7.0", + "symfony/dependency-injection": "^6.4 || ^7.0", + "symfony/doctrine-bridge": "^6.4.3 || ^7.0.3", + "symfony/framework-bundle": "^6.4 || ^7.0", "symfony/service-contracts": "^3" }, "require-dev": { @@ -50,18 +50,18 @@ "phpstan/phpstan-strict-rules": "^2", "phpunit/phpunit": "^12.3.10", "psr/log": "^3.0", - "symfony/doctrine-messenger": "^6.4 || ^7.0 || ^8.0", - "symfony/expression-language": "^6.4 || ^7.0 || ^8.0", - "symfony/messenger": "^6.4 || ^7.0 || ^8.0", - "symfony/property-info": "^6.4 || ^7.0 || ^8.0", - "symfony/security-bundle": "^6.4 || ^7.0 || ^8.0", - "symfony/stopwatch": "^6.4 || ^7.0 || ^8.0", - "symfony/string": "^6.4 || ^7.0 || ^8.0", - "symfony/twig-bridge": "^6.4 || ^7.0 || ^8.0", - "symfony/validator": "^6.4 || ^7.0 || ^8.0", - "symfony/var-exporter": "^6.4.1 || ^7.0.1 || ^8.0", - "symfony/web-profiler-bundle": "^6.4 || ^7.0 || ^8.0", - "symfony/yaml": "^6.4 || ^7.0 || ^8.0", + "symfony/doctrine-messenger": "^6.4 || ^7.0", + "symfony/expression-language": "^6.4 || ^7.0", + "symfony/messenger": "^6.4 || ^7.0", + "symfony/property-info": "^6.4 || ^7.0", + "symfony/security-bundle": "^6.4 || ^7.0", + "symfony/stopwatch": "^6.4 || ^7.0", + "symfony/string": "^6.4 || ^7.0", + "symfony/twig-bridge": "^6.4 || ^7.0", + "symfony/validator": "^6.4 || ^7.0", + "symfony/var-exporter": "^6.4.1 || ^7.0.1", + "symfony/web-profiler-bundle": "^6.4 || ^7.0", + "symfony/yaml": "^6.4 || ^7.0", "twig/twig": "^3.21.1" }, "conflict": { diff --git a/src/DependencyInjection/DoctrineExtension.php b/src/DependencyInjection/DoctrineExtension.php index 8a7880361..4dd3380a6 100644 --- a/src/DependencyInjection/DoctrineExtension.php +++ b/src/DependencyInjection/DoctrineExtension.php @@ -414,8 +414,10 @@ private function validateAutoMapping(array $managerConfigs): string|null /** * {@inheritDoc} + * + * @return void */ - public function load(array $configs, ContainerBuilder $container): void + public function load(array $configs, ContainerBuilder $container) { $configuration = $this->getConfiguration($configs, $container); $config = $this->processConfigurationPrependingDefaults($configuration, $configs); diff --git a/tests/DependencyInjection/AbstractDoctrineExtensionTestCase.php b/tests/DependencyInjection/AbstractDoctrineExtensionTestCase.php index c768cd033..7b687aed9 100644 --- a/tests/DependencyInjection/AbstractDoctrineExtensionTestCase.php +++ b/tests/DependencyInjection/AbstractDoctrineExtensionTestCase.php @@ -26,7 +26,6 @@ use PDO; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\IgnoreDeprecations; -use PHPUnit\Framework\Attributes\RequiresMethod; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterEventListenersAndSubscribersPass; use Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestHydrator; @@ -41,7 +40,6 @@ use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\ServiceLocator; use Symfony\Component\Security\Core\User\UserInterface; -use Symfony\Component\VarExporter\ProxyHelper; use function array_filter; use function array_keys; @@ -1186,7 +1184,6 @@ public function testDisableSchemaValidation(): void $this->assertFalse($collectorDefinition->getArguments()[1]); } - #[RequiresMethod(ProxyHelper::class, 'generateLazyGhost')] public function testNativeLazyObjectsWithoutConfig(): void { if (! interface_exists(EntityManagerInterface::class)) { @@ -1211,7 +1208,6 @@ public function testNativeLazyObjectsWithConfigTrue(): void $this->assertTrue($entityManager->getConfiguration()->isNativeLazyObjectsEnabled()); } - #[RequiresMethod(ProxyHelper::class, 'generateLazyGhost')] public function testNativeLazyObjectsWithConfigFalse(): void { if (! interface_exists(EntityManagerInterface::class)) { diff --git a/tests/DependencyInjection/DoctrineExtensionTest.php b/tests/DependencyInjection/DoctrineExtensionTest.php index 99db8fb1b..0d30d833a 100644 --- a/tests/DependencyInjection/DoctrineExtensionTest.php +++ b/tests/DependencyInjection/DoctrineExtensionTest.php @@ -973,7 +973,6 @@ public function testEntityAttributeExcludesFromContainer(string $class): void /** @phpstan-ignore function.alreadyNarrowedType */ $attributes = method_exists($container, 'getAttributeAutoconfigurators') ? array_map(static fn (array $arr) => $arr[0], $container->getAttributeAutoconfigurators()) - /** @phpstan-ignore method.notFound */ : $container->getAutoconfiguredAttributes(); $this->assertInstanceOf(Closure::class, $attributes[$class]); @@ -1003,7 +1002,6 @@ public function testAsEntityListenerAttribute(): void /** @phpstan-ignore function.alreadyNarrowedType */ $attributes = method_exists($container, 'getAttributeAutoconfigurators') ? array_map(static fn (array $arr) => $arr[0], $container->getAttributeAutoconfigurators()) - /** @phpstan-ignore method.notFound */ : $container->getAutoconfiguredAttributes(); $this->assertInstanceOf(Closure::class, $attributes[AsEntityListener::class]); @@ -1043,7 +1041,6 @@ public function testAsDoctrineListenerAttribute(): void /** @phpstan-ignore function.alreadyNarrowedType */ $attributes = method_exists($container, 'getAttributeAutoconfigurators') ? array_map(static fn (array $arr) => $arr[0], $container->getAttributeAutoconfigurators()) - /** @phpstan-ignore method.notFound */ : $container->getAutoconfiguredAttributes(); $this->assertInstanceOf(Closure::class, $attributes[AsDoctrineListener::class]); diff --git a/tests/DependencyInjection/Fixtures/DbalTestKernel.php b/tests/DependencyInjection/Fixtures/DbalTestKernel.php index 852ad90fa..45843e521 100644 --- a/tests/DependencyInjection/Fixtures/DbalTestKernel.php +++ b/tests/DependencyInjection/Fixtures/DbalTestKernel.php @@ -16,7 +16,6 @@ use function md5; use function mt_rand; use function sys_get_temp_dir; -use function version_compare; class DbalTestKernel extends Kernel { @@ -46,13 +45,6 @@ public function registerContainerConfiguration(LoaderInterface $loader): void 'http_method_override' => false, ]); - /** @phpstan-ignore if.alwaysFalse */ - if (version_compare(Kernel::VERSION, '7.0.0', '<')) { - $container->loadFromExtension('framework', [ - 'annotations' => ['enabled' => true], - ]); - } - $container->loadFromExtension('doctrine', [ 'dbal' => $this->dbalConfig, ]); diff --git a/tests/DependencyInjection/XmlDoctrineExtensionTest.php b/tests/DependencyInjection/XmlDoctrineExtensionTest.php index a13b025d0..4b57bf368 100644 --- a/tests/DependencyInjection/XmlDoctrineExtensionTest.php +++ b/tests/DependencyInjection/XmlDoctrineExtensionTest.php @@ -5,23 +5,18 @@ namespace Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection; use PHPUnit\Framework\Attributes\IgnoreDeprecations; -use PHPUnit\Framework\Attributes\RequiresMethod; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\Validator\Mapping\Loader\XmlFileLoader as LoaderXmlFileLoader; #[IgnoreDeprecations] -#[RequiresMethod(LoaderXmlFileLoader::class, 'loadFile')] class XmlDoctrineExtensionTest extends AbstractDoctrineExtensionTestCase { protected function loadFromFile( ContainerBuilder $container, string $file, ): void { - /** @phpstan-ignore class.notFound */ $loadXml = new XmlFileLoader($container, new FileLocator(__DIR__ . '/Fixtures/config/xml')); - /** @phpstan-ignore class.notFound */ $loadXml->import($file . '.{xml}'); } } diff --git a/tests/Polyfill/SymfonyApp.php b/tests/Polyfill/SymfonyApp.php index e4b0ea830..4987e0459 100644 --- a/tests/Polyfill/SymfonyApp.php +++ b/tests/Polyfill/SymfonyApp.php @@ -29,7 +29,6 @@ public function addCommand(callable|Command $command): Command|null */ public function add(Command $command): Command { - /** @phpstan-ignore staticMethod.notFound */ return parent::add($command); } }