File tree Expand file tree Collapse file tree 4 files changed +40
-6
lines changed
src/Symfony/Bridge/Doctrine Expand file tree Collapse file tree 4 files changed +40
-6
lines changed Original file line number Diff line number Diff line change 127127 "doctrine/annotations" : " ^1.13.1|^2" ,
128128 "doctrine/cache" : " ^1.11|^2.0" ,
129129 "doctrine/collections" : " ^1.0|^2.0" ,
130- "doctrine/data-fixtures" : " ^1.1" ,
130+ "doctrine/data-fixtures" : " ^1.1|^2 " ,
131131 "doctrine/dbal" : " ^2.13.1|^3.0" ,
132132 "doctrine/orm" : " ^2.7.4" ,
133133 "guzzlehttp/promises" : " ^1.4|^2.0" ,
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /*
4+ * This file is part of the Symfony package.
5+ *
6+ * (c) Fabien Potencier <[email protected] > 7+ *
8+ * For the full copyright and license information, please view the LICENSE
9+ * file that was distributed with this source code.
10+ */
11+
12+ namespace Symfony \Bridge \Doctrine \DataFixtures ;
13+
14+ use Doctrine \Common \DataFixtures \FixtureInterface ;
15+ use Doctrine \Common \DataFixtures \ReferenceRepository ;
16+
17+ if (method_exists (ReferenceRepository::class, 'getReferences ' )) {
18+ /** @internal */
19+ trait AddFixtureImplementation
20+ {
21+ public function addFixture (FixtureInterface $ fixture )
22+ {
23+ $ this ->doAddFixture ($ fixture );
24+ }
25+ }
26+ } else {
27+ /** @internal */
28+ trait AddFixtureImplementation
29+ {
30+ public function addFixture (FixtureInterface $ fixture ): void
31+ {
32+ $ this ->doAddFixture ($ fixture );
33+ }
34+ }
35+ }
Original file line number Diff line number Diff line change 2525 */
2626class ContainerAwareLoader extends Loader
2727{
28+ use AddFixtureImplementation;
29+
2830 private $ container ;
2931
3032 public function __construct (ContainerInterface $ container )
3133 {
3234 $ this ->container = $ container ;
3335 }
3436
35- /**
36- * {@inheritdoc}
37- */
38- public function addFixture (FixtureInterface $ fixture )
37+ private function doAddFixture (FixtureInterface $ fixture ): void
3938 {
4039 if ($ fixture instanceof ContainerAwareInterface) {
4140 $ fixture ->setContainer ($ this ->container );
Original file line number Diff line number Diff line change 4545 "symfony/var-dumper" : " ^4.4|^5.0|^6.0" ,
4646 "doctrine/annotations" : " ^1.10.4|^2" ,
4747 "doctrine/collections" : " ^1.0|^2.0" ,
48- "doctrine/data-fixtures" : " ^1.1" ,
48+ "doctrine/data-fixtures" : " ^1.1|^2 " ,
4949 "doctrine/dbal" : " ^2.13.1|^3|^4" ,
5050 "doctrine/orm" : " ^2.7.4|^3" ,
5151 "psr/log" : " ^1|^2|^3"
You can’t perform that action at this time.
0 commit comments