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.

Primitive::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
ccs 6
cts 6
cp 1
rs 9.4285
cc 1
eloc 5
nc 1
nop 3
crap 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace DDDGen\VO;
5
6
use Assert\Assert;
7
8
final class Primitive
9
{
10
    /** @var  string */
11
    private $name;
12
    /** @var  array */
13
    private $src_stubs;
14
    /** @var array */
15
    private $test_stubs;
16
    
17
    /**
18
     * Primitive constructor.
19
     *
20
     * @param string $name
21
     * @param string $alias
0 ignored issues
show
Bug introduced by
There is no parameter named $alias. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
22
     * @param array  $src_stubs
23
     * @param array  $test_stubs
24
     */
25 4
    public function __construct($name, array $src_stubs, array $test_stubs)
26
    {
27 4
        $this->name       = $name;
28 4
        $this->src_stubs  = $src_stubs;
29 4
        $this->test_stubs = $test_stubs;
30
        
31 4
        $this->validate();
32 3
    }
33
    
34
    /**
35
     * @return string
36
     */
37 3
    public function getName(): string
38
    {
39 3
        return $this->name;
40
    }
41
    
42
    /**
43
     * @return array
44
     */
45 3
    public function getSrcStubs(): array
46
    {
47 3
        return $this->src_stubs;
48
    }
49
    
50
    /**
51
     * @return array
52
     */
53 3
    public function getTestStubs(): array
54
    {
55 3
        return $this->test_stubs;
56
    }
57
    
58 4
    private function validate()
59
    {
60 4
        Assert::thatAll([$this->name])->minLength(1);
61 3
        Assert::that(count($this->test_stubs) + count($this->src_stubs))
62 3
              ->min(1, "Provide at least one stub for this primitive");
63
    }
64
}