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

TokenArray   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 24
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

3 Methods

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