| Conditions | 2 |
| Paths | 2 |
| Total Lines | 22 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 2.0023 |
| Changes | 4 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 40 | 81 | public function generate( |
|
| 41 | LoaderInterface $loader, |
||
| 42 | FixturesLoaderInterface $fixturesLoader, |
||
| 43 | array $bundles, |
||
| 44 | $environment |
||
| 45 | ) { |
||
| 46 | 81 | if (!$loader instanceof Loader) { |
|
| 47 | throw new \UnexpectedValueException('Unsupported loader for this generator. Must be an instance of Hautelook\AliceBundle\Alice\DataFixtures\Loader.'); |
||
| 48 | } |
||
| 49 | |||
| 50 | 81 | $doctrineDataLoaders = $this->fixturesFinder->getDataLoaders($bundles, $environment); |
|
| 51 | |||
| 52 | 81 | $_fixturesLoader = clone $fixturesLoader; |
|
| 53 | 81 | $_fixturesLoader->addProvider($doctrineDataLoaders); |
|
| 54 | |||
| 55 | 81 | return new Loader( |
|
| 56 | 81 | $_fixturesLoader, |
|
| 57 | 81 | $loader->getProcessorChain(), |
|
| 58 | 81 | $loader->getPersistOnce(), |
|
| 59 | 81 | $loader->getLoadingLimit() |
|
| 60 | 81 | ); |
|
| 61 | } |
||
| 62 | } |
||
| 63 |