Test Failed
Push — master ( ecd78b...d05c81 )
by Kirill
02:43
created

TypeValue   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 2

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A toString() 0 4 1
A __toString() 0 4 1
A getValue() 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\IR\Value;
11
12
use Railt\Reflection\Contracts\TypeInterface;
13
14
/**
15
 * Class TypeValue
16
 */
17
class TypeValue extends AbstractValue
18
{
19
    /**
20
     * TypeValue constructor.
21
     * @param TypeInterface $value
22
     * @param int $offset
23
     */
24
    public function __construct(TypeInterface $value, int $offset = 0)
25
    {
26
        parent::__construct($value, $offset);
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function toString(): string
33
    {
34
        return $this->getValue()->getName();
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function __toString(): string
41
    {
42
        return 'typeof ' . parent::__toString();
43
    }
44
45
    /**
46
     * @return TypeInterface
47
     */
48
    public function getValue(): TypeInterface
49
    {
50
        return parent::getValue();
51
    }
52
}
53