| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | 64 | public function parse(TokenStream $tokenStream) |
|
| 27 | { |
||
| 28 | 64 | foreach ($this->nodeParsers as $nodeParser) { |
|
| 29 | 64 | if ($nodeParser->supports($tokenStream)) { |
|
| 30 | 63 | return $nodeParser->parse($tokenStream); |
|
| 31 | } |
||
| 32 | 64 | } |
|
| 33 | |||
| 34 | 1 | throw new SyntaxErrorException( |
|
| 35 | 1 | sprintf( |
|
| 36 | 1 | 'Unexpected token "%s" (%s) at position %d', |
|
| 37 | 1 | $tokenStream->getCurrent()->getValue(), |
|
| 38 | 1 | $tokenStream->getCurrent()->getName(), |
|
| 39 | 1 | $tokenStream->getCurrent()->getStart() |
|
| 40 | 1 | ) |
|
| 41 | 1 | ); |
|
| 42 | } |
||
| 43 | |||
| 58 |