GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — 1.x ( ecb649...535f6c )
by Théo
13:20
created

LoaderGenerator::generate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 22
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 2.0023

Importance

Changes 4
Bugs 1 Features 0
Metric Value
c 4
b 1
f 0
dl 0
loc 22
ccs 11
cts 12
cp 0.9167
rs 9.2
cc 2
eloc 15
nc 2
nop 4
crap 2.0023
1
<?php
2
3
/*
4
 * This file is part of the Hautelook\AliceBundle package.
5
 *
6
 * (c) Baldur Rensch <[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 Hautelook\AliceBundle\Doctrine\Generator;
13
14
use Hautelook\AliceBundle\Alice\DataFixtures\Fixtures\LoaderInterface as FixturesLoaderInterface;
15
use Hautelook\AliceBundle\Alice\DataFixtures\Loader;
16
use Hautelook\AliceBundle\Alice\DataFixtures\LoaderInterface;
17
use Hautelook\AliceBundle\Doctrine\Finder\FixturesFinder;
18
19
/**
20
 * @author Théo FIDRY <[email protected]>
21
 */
22
class LoaderGenerator implements LoaderGeneratorInterface
23
{
24
    /**
25
     * @var FixturesFinder
26
     */
27
    private $fixturesFinder;
28
29
    /**
30
     * @param FixturesFinder $fixturesFinder
31
     */
32 123
    public function __construct(FixturesFinder $fixturesFinder)
33
    {
34 123
        $this->fixturesFinder = $fixturesFinder;
35 123
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
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