File tree 4 files changed +46
-6
lines changed
10000
src/Symfony/Bridge/Doctrine
4 files changed +46
-6
lines changed Original file line number Diff line number Diff line change 127
127
"doctrine/annotations" : " ^1.13.1|^2" ,
128
128
"doctrine/cache" : " ^1.11|^2.0" ,
129
129
"doctrine/collections" : " ^1.0|^2.0" ,
130
- "doctrine/data-fixtures" : " ^1.1" ,
130
+ "doctrine/data-fixtures" : " ^1.1|^2 " ,
131
131
"doctrine/dbal" : " ^2.13.1|^3.0" ,
132
132
"doctrine/orm" : " ^2.7.4" ,
133
133
"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 <fabien@symfony.com>
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
+ /**
22
+ * {@inheritdoc}
23
+ */
24
+ public function addFixture (FixtureInterface $ fixture )
25
+ {
26
+ $ this ->doAddFixture ($ fixture );
27
+ }
28
+ }
29
+ } else {
30
+ /** @internal */
31
+ trait AddFixtureImplementation
32
+ {
33
+ /**
34
+ * {@inheritdoc}
35
+ */
36
+ public function addFixture (FixtureInterface $ fixture ): void
37
+ {
38
+ $ this ->doAddFixture ($ fixture );
39
+ }
40
+ }
41
+ }
Original file line number Diff line number Diff line change 25
25
*/
26
26
class ContainerAwareLoader extends Loader
27
27
{
28
+ use AddFixtureImplementation;
29
+
28
30
private $ container ;
29
31
30
32
public function __construct (ContainerInterface $ container )
31
33
{
32
34
$ this ->container = $ container ;
33
35
}
34
36
35
- /**
36
- * {@inheritdoc}
37
- */
38
- public function addFixture (FixtureInterface $ fixture )
37
+ private function doAddFixture (FixtureInterface $ fixture ): void
39
38
{
40
39
if ($ fixture instanceof ContainerAwareInterface) {
41
40
$ fixture ->setContainer ($ this ->container );
Original file line number Diff line number Diff line change 45
45
"symfony/var-dumper" : " ^4.4|^5.0|^6.0" ,
46
46
"doctrine/annotations" : " ^1.10.4|^2" ,
47
47
"doctrine/collections" : " ^1.0|^2.0" ,
48
- "doctrine/data-fixtures" : " ^1.1" ,
48
+ "doctrine/data-fixtures" : " ^1.1|^2 " ,
49
49
"doctrine/dbal" : " ^2.13.1|^3|^4" ,
50
50
"doctrine/orm" : " ^2.7.4|^3" ,
51
51
"psr/log" : " ^1|^2|^3"
You can’t perform that action at this time.
0 commit comments