diff --git a/Loader/SymfonyFixturesLoader.php b/Loader/SymfonyFixturesLoader.php index 43766069..cac5c8ab 100644 --- a/Loader/SymfonyFixturesLoader.php +++ b/Loader/SymfonyFixturesLoader.php @@ -40,15 +40,10 @@ public function addFixtures(array $fixtures) public function addFixture(FixtureInterface $fixture) { $class = get_class($fixture); - if (isset($this->loadedFixtures[$class]) && $this->loadedFixtures[$class] !== $fixture) { - throw new \LogicException(sprintf( - 'The "%s" fixture class is already loaded and instantiated. It is not possible to add a new instance of this fixture. Upgrade to "doctrine/data-fixtures" version 1.3 or higher to support this.', - $class - )); + if (!isset($this->loadedFixtures[$class])) { + $this->loadedFixtures[$class] = $fixture; } - $this->loadedFixtures[$class] = $fixture; - // see https://github.com/doctrine/data-fixtures/pull/274 // this is to give a clear error if you do not have this version if (!method_exists(Loader::class, 'createFixture')) {