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

Argument::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
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