Skip to content

Commit

Permalink
Merge branch '4.7.x' into 5.0.x
Browse files Browse the repository at this point in the history
* 4.7.x:
  Deprecate container injection in fixture classes with ContainerAwareInterface (#801)
  • Loading branch information
GromNaN committed Dec 11, 2023
2 parents b07f049 + c53d147 commit 0f6d04c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Loader/SymfonyFixturesLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use function array_values;
use function get_class;
use function sprintf;
use function trigger_deprecation;

final class SymfonyFixturesLoader extends Loader implements SymfonyFixturesLoaderInterface
{
Expand Down Expand Up @@ -68,6 +69,8 @@ public function addFixture(FixtureInterface $fixture): void
}

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);
}

Expand Down
2 changes: 2 additions & 0 deletions UPGRADE-4.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ UPGRADE FROM 4.6 to 4.7
* The `fixture_loader` configuration option was deprecated and will be removed
in 5.0.
* The `doctrine_mongodb.odm.fixture_loader` parameter has been removed.
* Implementing `ContainerAwareInterface` on fixtures classes is deprecated,
use dependency injection instead.

0 comments on commit 0f6d04c

Please sign in to comment.