Conditions | 4 |
Paths | 6 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
23 | 10 | public function call($offset = null): BaseToken |
|
24 | { |
||
25 | 10 | $tokenValue = $this->token->getValue(); |
|
26 | |||
27 | 10 | if (!$offset) { |
|
28 | 2 | $offset = 0; |
|
29 | 8 | } elseif (!$offset instanceof TokenInteger) { |
|
30 | 2 | $offset = (int) $offset->getValue(); |
|
31 | } else { |
||
32 | 6 | $offset = $offset->getValue(); |
|
33 | } |
||
34 | |||
35 | 10 | if (!isset($tokenValue[$offset])) { |
|
36 | 2 | $char = ''; |
|
37 | } else { |
||
38 | 8 | $char = $tokenValue[$offset]; |
|
39 | } |
||
40 | |||
41 | 10 | return new TokenString($char); |
|
42 | } |
||
43 | } |
||
44 |