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 — master ( a51d8d...661062 )
by Edi
23:20
created

SiteAccessGroupVoterTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 20.93 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 9
loc 43
rs 10
c 0
b 0
f 0

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
namespace Netgen\Bundle\SiteAccessRoutesBundle\Tests\Matcher\Voter;
4
5
use Netgen\Bundle\SiteAccessRoutesBundle\Matcher\Voter\SiteAccessGroupVoter;
6
use Netgen\Bundle\SiteAccessRoutesBundle\Matcher\Voter\VoterInterface;
7
use Netgen\Bundle\SiteAccessRoutesBundle\Tests\TestCase;
8
9
class SiteAccessGroupVoterTest extends TestCase
10
{
11
    /**
12
     * @var \Netgen\Bundle\SiteAccessRoutesBundle\Matcher\Voter\SiteAccessGroupVoter
13
     */
14
    protected $voter;
15
16
    public function setUp()
17
    {
18
        $this->voter = new SiteAccessGroupVoter(
19
            array(
20
                'eng' => array('frontend'),
21
                'cro' => array('frontend'),
22
                'admin' => array('backend'),
23
            )
24
        );
25
    }
26
27
    /**
28
     * @param string $siteAccess
29
     * @param array $groupConfig
30
     * @param bool $vote
31
     *
32
     * @covers \Netgen\Bundle\SiteAccessRoutesBundle\Matcher\Voter\SiteAccessGroupVoter::__construct
33
     * @covers \Netgen\Bundle\SiteAccessRoutesBundle\Matcher\Voter\SiteAccessGroupVoter::vote
34
     *
35
     * @dataProvider voteProvider
36
     */
37
    public function testVote($siteAccess, array $groupConfig, $vote)
38
    {
39
        $this->assertEquals($vote, $this->voter->vote($siteAccess, $groupConfig));
40
    }
41
42
    public function voteProvider()
43
    {
44
        return array(
45
            array('cro', array('cro', 'backend'), VoterInterface::ABSTAIN),
46
            array('eng', array('cro', 'backend'), VoterInterface::ABSTAIN),
47
            array('admin', array('cro', 'backend'), true),
48
            array('extra', array('cro', 'backend'), VoterInterface::ABSTAIN),
49
        );
50
    }
51
}
52