Completed
Push — master ( dbdf9d...5ad886 )
by Jaap
02:58 queued 10s
created

Iterable_   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 12 3
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
 * Value Object representing iterable type
20
 */
21
final class Iterable_ extends AbstractList
22
{
23
    /**
24
     * Returns a rendered output of the Type as it would be used in a DocBlock.
25
     */
26 5
    public function __toString() : string
27
    {
28 5
        if ($this->keyType) {
29 1
            return 'iterable<' . $this->keyType . ',' . $this->valueType . '>';
30
        }
31
32 4
        if ($this->valueType instanceof Mixed_) {
33 2
            return 'iterable';
34
        }
35
36 2
        return 'iterable<' . $this->valueType . '>';
37
    }
38
}
39