-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dynamically fix compatibility with doctrine/data-fixtures v2
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.
- Loading branch information
1 parent
4b8695c
commit 1812aaf
Showing
4 changed files
with
40 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/Symfony/Bridge/Doctrine/DataFixtures/AddFixtureImplementation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Bridge\Doctrine\DataFixtures; | ||
|
||
use Doctrine\Common\DataFixtures\FixtureInterface; | ||
use Doctrine\Common\DataFixtures\ReferenceRepository; | ||
|
||
if (method_exists(ReferenceRepository::class, 'getReferences')) { | ||
/** @internal */ | ||
trait AddFixtureImplementation | ||
{ | ||
public function addFixture(FixtureInterface $fixture) | ||
{ | ||
$this->doAddFixture($fixture); | ||
} | ||
} | ||
} else { | ||
/** @internal */ | ||
trait AddFixtureImplementation | ||
Check failure on line 28 in src/Symfony/Bridge/Doctrine/DataFixtures/AddFixtureImplementation.php GitHub Actions / PsalmDuplicateClass
Check failure on line 28 in src/Symfony/Bridge/Doctrine/DataFixtures/AddFixtureImplementation.php GitHub Actions / PsalmDuplicateClass
|
||
{ | ||
public function addFixture(FixtureInterface $fixture): void | ||
Check failure on line 30 in src/Symfony/Bridge/Doctrine/DataFixtures/AddFixtureImplementation.php GitHub Actions / PsalmMethodSignatureMismatch
Check failure on line 30 in src/Symfony/Bridge/Doctrine/DataFixtures/AddFixtureImplementation.php GitHub Actions / PsalmMethodSignatureMismatch
|
||
{ | ||
$this->doAddFixture($fixture); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters