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 — master (#54)
by joseph
28:13 queued 24:17
created

php$0 ➔ testGetGettersAndSetters()   A

Complexity

Conditions 1

Size

Total Lines 55

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 55
rs 9.7692
c 0
b 0
f 0
cc 1

9 Methods

Rating   Name   Duplication   Size   Complexity  
A UsesPHPMetaDataTraitUnitTest.php$0 ➔ setThat() 0 2 1
A UsesPHPMetaDataTraitUnitTest.php$0 ➔ getSomething() 0 2 1
A UsesPHPMetaDataTraitUnitTest.php$0 ➔ setCustomRepositoryClass() 0 2 1
A UsesPHPMetaDataTraitUnitTest.php$0 ➔ setThis() 0 2 1
A UsesPHPMetaDataTraitUnitTest.php$0 ➔ getThat() 0 2 1
A UsesPHPMetaDataTraitUnitTest.php$0 ➔ getThis() 0 2 1
A UsesPHPMetaDataTraitUnitTest.php$0 ➔ setSomething() 0 2 1
A UsesPHPMetaDataTraitUnitTest.php$0 ➔ getSomethingElse() 0 2 1
A UsesPHPMetaDataTraitUnitTest.php$0 ➔ setSomethingElse() 0 2 1

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Entity\Traits;
4
5
use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder;
6
use PHPUnit\Framework\TestCase;
7
8
/**
9
 * Class UsesPHPMetaDataTraitUnitTest
10
 *
11
 * @package EdmondsCommerce\DoctrineStaticMeta\Entity\Traits
12
 * @SuppressWarnings(PHPMD.UnusedLocalVariable)
13
 */
14
class UsesPHPMetaDataTraitUnitTest extends TestCase
15
{
16
17
18
    public function testGetGettersAndSetters()
19
    {
20
        $testClass = new class ()
21
        {
22
            use UsesPHPMetaDataTrait;
23
24
            protected static function setCustomRepositoryClass(ClassMetadataBuilder $builder)
0 ignored issues
show
Unused Code introduced by
The parameter $builder is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

24
            protected static function setCustomRepositoryClass(/** @scrutinizer ignore-unused */ ClassMetadataBuilder $builder)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
25
            {
26
                // TODO: Implement setCustomRepositoryClass() method.
27
            }
28
29
            public function getThis()
30
            {
31
            }
32
33
            public function getThat()
34
            {
35
            }
36
37
            public function setThis()
38
            {
39
            }
40
41
            public function setThat()
42
            {
43
            }
44
45
            private function getSomething()
46
            {
47
            }
48
49
            private function setSomething()
50
            {
51
            }
52
53
            protected function getSomethingElse()
54
            {
55
            }
56
57
            protected function setSomethingElse()
58
            {
59
            }
60
        };
61
        $expected  = [
62
            'getThis',
63
            'getThat',
64
        ];
65
        $actual    = $testClass->getGetters();
66
        $this->assertSame($expected, $actual);
67
        $expected = [
68
            'setThis',
69
            'setThat',
70
        ];
71
        $actual   = $testClass->getSetters();
72
        $this->assertSame($expected, $actual);
73
    }
74
}
75