Completed
Push — master ( d6f6df...50f391 )
by Jaap
28:46 queued 18:49
created

Expression_::__toString()   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
namespace phpDocumentor\Reflection\Types;
14
15
use phpDocumentor\Reflection\Type;
16
17
/**
18
 * Represents an expression type as described in the PSR-5, the PHPDoc Standard.
19
 */
20
final class Expression_ implements Type
21
{
22
    /** @var Type */
23
    protected $valueType;
24
25
    /**
26
     * Initializes this representation of an array with the given Type.
27
     */
28
    public function __construct(Type $valueType)
29
    {
30
        $this->valueType = $valueType;
31
    }
32
33
    /**
34
     * Returns the value for the keys of this array.
35
     */
36
    public function getValueType() : Type
37
    {
38
        return $this->valueType;
39
    }
40
41
    /**
42
     * Returns a rendered output of the Type as it would be used in a DocBlock.
43
     */
44
    public function __toString() : string
45
    {
46
        return '(' . $this->valueType . ')';
47
    }
48
}
49