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

TestCase   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 50
Duplicated Lines 54 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 27
loc 50
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;
4
5
use PHPUnit_Framework_TestCase;
6
7
/**
8
 * This class is a compatibility layer for using
9
 * PHPUnit 4.8 on PHP 5.5 and PHPUnit 5.5 on PHP >= 5.6.
10
 */
11
class TestCase extends PHPUnit_Framework_TestCase
12
{
13
    /**
14
     * Returns a test double for the specified class.
15
     *
16
     * @param string $originalClassName
17
     *
18
     * @throws \PHPUnit_Framework_Exception
19
     *
20
     * @return \PHPUnit_Framework_MockObject_MockObject
21
     */
22
    protected function createMock($originalClassName)
23
    {
24
        if (method_exists(PHPUnit_Framework_TestCase::class, 'createMock')) {
25
            return parent::createMock($originalClassName);
26
        }
27
28
        return $this
29
            ->getMockBuilder($originalClassName)
30
            ->disableOriginalConstructor()
31
            ->disableOriginalClone()
32
            ->disableArgumentCloning()
33
            ->getMock();
34
    }
35
36
    /**
37
     * Returns a partial test double for the specified class.
38
     *
39
     * @param string $originalClassName
40
     * @param array $methods
41
     *
42
     * @throws \PHPUnit_Framework_Exception
43
     *
44
     * @return \PHPUnit_Framework_MockObject_MockObject
45
     */
46
    protected function createPartialMock($originalClassName, array $methods)
47
    {
48
        if (method_exists(PHPUnit_Framework_TestCase::class, 'createPartialMock')) {
49
            return parent::createPartialMock($originalClassName, $methods);
50
        }
51
52
        return $this
53
            ->getMockBuilder($originalClassName)
54
            ->disableOriginalConstructor()
55
            ->disableOriginalClone()
56
            ->disableArgumentCloning()
57
            ->setMethods($methods)
58
            ->getMock();
59
    }
60
}
61