Conditions | 3 |
Paths | 2 |
Total Lines | 20 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
30 | private function executeExecutor( |
||
31 | ExecutorInterface $executor, |
||
32 | ObjectManager $manager, |
||
33 | LoaderInterface $loader, |
||
34 | array $fixtures, |
||
35 | $append = false |
||
36 | ) { |
||
37 | 102 | $function = function (ObjectManager $manager) use ($executor, $loader, $fixtures, $append) { |
|
38 | 96 | if (false === $append) { |
|
39 | 84 | $executor->purge(); |
|
40 | 84 | } |
|
41 | 96 | $loader->load(new Doctrine($manager), $fixtures); |
|
42 | 102 | }; |
|
43 | |||
44 | 102 | if (method_exists($manager, 'transactional')) { |
|
45 | 84 | $manager->transactional($function); |
|
46 | 84 | } else { |
|
47 | 24 | $function($manager); |
|
48 | } |
||
49 | 102 | } |
|
50 | } |
||
51 |