| Conditions | 4 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | 84 | public function getTokenAt($code, $cursor) |
|
| 14 | { |
||
| 15 | 84 | if (!preg_match('/([a-z0-9\*\?]|\%[0-9a-f]{2})+/Ai', $code, $matches, null, $cursor)) { |
|
| 16 | 14 | return null; |
|
| 17 | 84 | } elseif (strpos($matches[0], '?') === false && strpos($matches[0], '*') === false) { |
|
| 18 | 84 | return null; |
|
| 19 | } |
||
| 20 | |||
| 21 | 22 | return new Token( |
|
| 22 | 22 | Token::T_GLOB, |
|
| 23 | 22 | $this->decodeGlob($matches[0]), |
|
| 24 | 22 | $cursor, |
|
| 25 | 22 | $cursor + strlen($matches[0]) |
|
| 26 | 22 | ); |
|
| 27 | } |
||
| 28 | |||
| 40 |