Completed
Push — master ( 6be94d...a1eb14 )
by Jaap
06:00
created

Expression::getValueType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of phpDocumentor.
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @link      http://phpdoc.org
12
 */
13
14
namespace phpDocumentor\Reflection\Types;
15
16
use phpDocumentor\Reflection\Type;
17
18
/**
19
 * Represents an expression type as described in the PSR-5, the PHPDoc Standard.
20
 *
21
 * @psalm-immutable
22
 */
23
final class Expression implements Type
24
{
25
    /** @var Type */
26
    protected $valueType;
27
28
    /**
29
     * Initializes this representation of an array with the given Type.
30
     */
31
    public function __construct(Type $valueType)
32
    {
33
        $this->valueType = $valueType;
34
    }
35
36
    /**
37
     * Returns the value for the keys of this array.
38
     */
39
    public function getValueType() : Type
40
    {
41
        return $this->valueType;
42
    }
43
44
    /**
45
     * Returns a rendered output of the Type as it would be used in a DocBlock.
46
     */
47
    public function __toString() : string
48
    {
49
        return '(' . $this->valueType . ')';
50
    }
51
}
52