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

ExecutorTrait::executeExecutor()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 20
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 3

Importance

Changes 3
Bugs 1 Features 0
Metric Value
c 3
b 1
f 0
dl 0
loc 20
ccs 11
cts 11
cp 1
rs 9.4285
cc 3
eloc 14
nc 2
nop 5
crap 3
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\DataFixtures\Executor;
13
14
use Doctrine\Common\Persistence\ObjectManager;
15
use Hautelook\AliceBundle\Alice\DataFixtures\LoaderInterface;
16
use Nelmio\Alice\Persister\Doctrine;
17
18
/**
19
 * @author Théo FIDRY <[email protected]>
20
 */
21
trait ExecutorTrait
22
{
23
    /**
24
     * @param ExecutorInterface $executor
25
     * @param ObjectManager     $manager
26
     * @param LoaderInterface   $loader
27
     * @param string[]          $fixtures Real path to fixtures files
28
     * @param bool              $append
29
     */
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