Completed
Push — master ( 4cc554...e2bb59 )
by Nico
01:55
created

TokenArray::toArray()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

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