NamedParameter::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Annotations\Parser\Ast\Parameter;
6
7
use Doctrine\Annotations\Parser\Ast\Parameter;
8
use Doctrine\Annotations\Parser\Ast\Scalar\Identifier;
9
use Doctrine\Annotations\Parser\Ast\ValuableNode;
10
use Doctrine\Annotations\Parser\Visitor\Visitor;
11
12
final class NamedParameter implements Parameter
13
{
14
    /** @var Identifier */
15
    private $name;
16
17
    /** @var ValuableNode */
18
    private $value;
19
20 13
    public function __construct(Identifier $name, ValuableNode $value)
21
    {
22 13
        $this->name  = $name;
23 13
        $this->value = $value;
24 13
    }
25
26 4
    public function getName() : Identifier
27
    {
28 4
        return $this->name;
29
    }
30
31 4
    public function getValue() : ValuableNode
32
    {
33 4
        return $this->value;
34
    }
35
36 4
    public function dispatch(Visitor $visitor) : void
37
    {
38 4
        $visitor->visitNamedParameter($this);
39 4
    }
40
}
41