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
Pull Request — 1.x (#220)
by Eric
37:13 queued 34:44
created

PHPCRExecutor   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 1 Features 1
Metric Value
wmc 2
c 4
b 1
f 1
lcom 1
cbo 2
dl 29
loc 29
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 4 4 1
A __construct() 6 6 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

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\DataFixtures\Executor\PHPCRExecutor as DoctrinePHPCRExecutor;
15
use Doctrine\Common\DataFixtures\Purger\PHPCRPurger;
16
use Doctrine\ODM\PHPCR\DocumentManager;
17
use Hautelook\AliceBundle\Alice\DataFixtures\LoaderInterface;
18
19
/**
20
 * Class responsible for executing data fixtures.
21
 *
22
 * @author Théo FIDRY <[email protected]>
23
 */
24 View Code Duplication
class PHPCRExecutor extends DoctrinePHPCRExecutor implements ExecutorInterface
25
{
26
    use ExecutorTrait;
27
28
    /**
29
     * @var LoaderInterface
30
     */
31
    private $loader;
32
33
    /**
34
     * Construct new fixtures loader instance.
35
     *
36
     * @param DocumentManager $manager DocumentManager instance used for persistence.
37
     * @param LoaderInterface $loader
38
     * @param PHPCRPurger     $purger
39
     */
40 12
    public function __construct(DocumentManager $manager, LoaderInterface $loader, PHPCRPurger $purger = null)
41
    {
42 12
        parent::__construct($manager, $purger);
43
44 12
        $this->loader = $loader;
45 12
    }
46
47
    /** {@inheritdoc} */
48 12
    public function execute(array $fixtures, $append = false)
49
    {
50 12
        $this->executeExecutor($this, $this->getObjectManager(), $this->loader, $fixtures, $append);
51 12
    }
52
}
53