TokenArray   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 17
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A toArray() 0 10 2
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