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   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 93.33%

Importance

Changes 4
Bugs 1 Features 0
Metric Value
wmc 3
c 4
b 1
f 0
lcom 1
cbo 3
dl 0
loc 41
ccs 14
cts 15
cp 0.9333
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A generate() 0 22 2
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