diff --git a/Loader/SymfonyFixturesLoader.php b/Loader/SymfonyFixturesLoader.php index 22c141aa..61f8876e 100644 --- a/Loader/SymfonyFixturesLoader.php +++ b/Loader/SymfonyFixturesLoader.php @@ -12,14 +12,11 @@ use LogicException; use ReflectionClass; use RuntimeException; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; use function array_key_exists; use function array_values; use function get_class; use function sprintf; -use function trigger_deprecation; final class SymfonyFixturesLoader extends Loader implements SymfonyFixturesLoaderInterface { @@ -29,11 +26,6 @@ final class SymfonyFixturesLoader extends Loader implements SymfonyFixturesLoade /** @var array> */ private array $groupsFixtureMapping = []; - public function __construct( - private ContainerInterface $container, - ) { - } - /** * @internal * @@ -68,12 +60,6 @@ public function addFixture(FixtureInterface $fixture): void $this->addGroupsFixtureMapping($class, $fixture::getGroups()); } - if ($fixture instanceof ContainerAwareInterface) { - trigger_deprecation('doctrine/mongodb-odm-bundle', '4.7', 'Implementing "%s" with "%s" is deprecated, use dependency injection instead.', ContainerAwareInterface::class, FixtureInterface::class); - - $fixture->setContainer($this->container); - } - parent::addFixture($fixture); } diff --git a/Resources/config/mongodb.xml b/Resources/config/mongodb.xml index 9317d7b0..0cf838b6 100644 --- a/Resources/config/mongodb.xml +++ b/Resources/config/mongodb.xml @@ -183,8 +183,6 @@ - - - + diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md index a9c0584d..8657add2 100644 --- a/UPGRADE-5.0.md +++ b/UPGRADE-5.0.md @@ -13,3 +13,5 @@ UPGRADE FROM 4.x to 5.0 used directly or extended. * Remove support of Annotation mapping, you should use Attributes or XML instead. * Remove `--service` option from `doctrine:mongodb:fixtures:load` command +* Remove automatic injection of the container in fixtures classes implementing + `ContainerAwareInterface`. You should use dependency injection instead. diff --git a/psalm-baseline.xml b/psalm-baseline.xml index bc24f184..d33c7f8b 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -16,11 +16,6 @@ children - - - private ContainerInterface $container - - GuesserTestType