You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #58865 Dynamically fix compatibility with doctrine/data-fixtures v2 (greg0ire)
This PR was merged into the 5.4 branch.
Discussion
----------
Dynamically fix compatibility with doctrine/data-fixtures v2
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Issues | see explanation below
| License | MIT
While working on [allowing v2 of doctrine/data-fixtures in the bundle](doctrine/DoctrineFixturesBundle#457), I stumbled upon an issue that only affects some versions of Symfony that still have a `ContainerAwareLoader` class.
The signature of `ContainerAwareLoader::addFixture()` is not compatible with the v2 signature of the `Loader` interface from `doctrine/data-fixtures`, as per this fatal error:
```
Declaration of Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader::addFixture(Doctrine\Common\DataFixtures\FixtureInterface $fixture)
must be compatible with Doctrine\Common\DataFixtures\Loader::addFixture(Doctrine\Common\DataFixtures\FixtureInterface $fixture): void
```
Classes that extend ContainerAwareLoader have to also extend Loader, meaning this is no breaking change because it can be argued that the incompatibility of the extending class would be with the Loader interface.
Closes#58861, Closes#58863
Commits
-------
1812aaf Dynamically fix compatibility with doctrine/data-fixtures v2
0 commit comments