TokenArray::toArray()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 10
ccs 5
cts 5
cp 1
crap 2
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
/**
4
 * @license     http://opensource.org/licenses/mit-license.php MIT
5
 * @link        https://github.com/nicoSWD
6
 * @author      Nicolas Oelgart <[email protected]>
7
 */
8
namespace nicoSWD\Rule\TokenStream\Token;
9
10
final class TokenArray extends BaseToken
11
{
12 42
    public function getType(): int
13
    {
14 42
        return TokenType::VALUE;
15
    }
16
17 2
    public function toArray(): array
18
    {
19 2
        $items = [];
20
21 2
        foreach ($this->getValue() as $value) {
22
            /** @var self $value */
23 2
            $items[] = $value->getValue();
24
        }
25
26 2
        return $items;
27
    }
28
}
29