Conditions | 3 |
Paths | 4 |
Total Lines | 22 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
23 | 12 | public function call($start = null, $offset = null): BaseToken |
|
24 | { |
||
25 | 12 | $params = []; |
|
26 | |||
27 | 12 | if (!$start) { |
|
28 | 2 | $params[] = 0; |
|
29 | } else { |
||
30 | 10 | $params[] = (int) $start->getValue(); |
|
31 | } |
||
32 | |||
33 | 12 | if ($offset) { |
|
34 | 4 | $params[] = (int) $offset->getValue(); |
|
35 | } |
||
36 | |||
37 | 12 | $value = substr($this->token->getValue(), ...$params); |
|
38 | |||
39 | 12 | return new TokenString( |
|
40 | 12 | (string) $value, |
|
41 | 12 | $this->token->getOffset(), |
|
42 | 12 | $this->token->getStack() |
|
43 | ); |
||
44 | } |
||
45 | } |
||
46 |