| Conditions | 7 |
| Paths | 7 |
| Total Lines | 19 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 7 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 12 | 85 | public function getTokenAt($code, $cursor) |
|
| 13 | { |
||
| 14 | 85 | $test = substr($code, $cursor, 1); |
|
| 15 | 85 | if ($test === '&') { |
|
| 16 | 29 | return new Token(Token::T_AMPERSAND, $test, $cursor, $cursor + 1); |
|
| 17 | 85 | } elseif ($test === '|') { |
|
| 18 | 6 | return new Token(Token::T_VERTICAL_BAR, $test, $cursor, $cursor + 1); |
|
| 19 | 85 | } elseif ($test === ',') { |
|
| 20 | 76 | return new Token(Token::T_COMMA, $test, $cursor, $cursor + 1); |
|
| 21 | 85 | } elseif ($test === '(') { |
|
| 22 | 82 | return new Token(Token::T_OPEN_PARENTHESIS, $test, $cursor, $cursor + 1); |
|
| 23 | 85 | } elseif ($test === ')') { |
|
| 24 | 78 | return new Token(Token::T_CLOSE_PARENTHESIS, $test, $cursor, $cursor + 1); |
|
| 25 | 85 | } elseif ($test === ':') { |
|
| 26 | 9 | return new Token(Token::T_COLON, $test, $cursor, $cursor + 1); |
|
| 27 | } else { |
||
| 28 | 85 | return null; |
|
| 29 | } |
||
| 30 | } |
||
| 31 | } |
||
| 32 |