Test Failed
Push — master ( b7ab7b...94ee03 )
by Kirill
02:59
created

Argument   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 47
ccs 0
cts 17
cp 0
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getName() 0 4 1
A getHint() 0 4 1
A __toString() 0 4 1
1
<?php
2
/**
3
 * This file is part of Railt package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Railt\SDL\Frontend\Builder\Definition;
11
12
use Railt\SDL\IR\Type\TypeNameInterface;
13
14
/**
15
 * Class Argument
16
 */
17
class Argument implements DefinitionArgumentInterface
18
{
19
    /**
20
     * @var string
21
     */
22
    private $name;
23
24
    /**
25
     * @var TypeNameInterface
26
     */
27
    private $type;
28
29
    /**
30
     * Argument constructor.
31
     * @param string $name
32
     * @param TypeNameInterface $type
33
     */
34
    public function __construct(string $name, TypeNameInterface $type)
35
    {
36
        $this->name = $name;
37
        $this->type = $type;
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function getName(): string
44
    {
45
        return $this->name;
46
    }
47
48
    /**
49
     * @return TypeNameInterface
50
     */
51
    public function getHint(): TypeNameInterface
52
    {
53
        return $this->type;
54
    }
55
56
    /**
57
     * @return string
58
     */
59
    public function __toString(): string
60
    {
61
        return $this->getName() . ': ' . $this->getHint()->getFullyQualifiedName();
62
    }
63
}
64