Conditions | 3 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
16 | 12 | public function call(?BaseToken ...$parameters): BaseToken |
|
17 | { |
||
18 | 12 | $params = []; |
|
19 | 12 | $start = $this->parseParameter($parameters, numParam: 0); |
|
20 | |||
21 | 12 | if (!$start) { |
|
22 | 2 | $params[] = 0; |
|
23 | } else { |
||
24 | 10 | $params[] = (int) $start->getValue(); |
|
25 | } |
||
26 | |||
27 | 12 | $offset = $this->parseParameter($parameters, numParam: 1); |
|
28 | |||
29 | 12 | if ($offset) { |
|
30 | 4 | $params[] = (int) $offset->getValue(); |
|
31 | } |
||
32 | |||
33 | 12 | $value = substr($this->token->getValue(), ...$params); |
|
34 | |||
35 | 12 | return new TokenString((string) $value); |
|
36 | } |
||
38 |