| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 5 | public function parse(ContextInterface $context, Cursor $cursor): bool |
|
| 24 | 5 | { |
|
| 25 | 5 | $state = $cursor->saveState(); |
|
| 26 | 4 | $attributes = AttributesUtils::parse($cursor); |
|
| 27 | if (empty($attributes)) { |
||
| 28 | return false; |
||
| 29 | 5 | } |
|
| 30 | 3 | ||
| 31 | if (null !== $cursor->getNextNonSpaceCharacter()) { |
||
| 32 | 3 | $cursor->restoreState($state); |
|
| 33 | |||
| 34 | return false; |
||
| 35 | 5 | } |
|
| 36 | 5 | ||
| 37 | $context->addBlock(new Attributes($attributes)); |
||
| 38 | 5 | $context->setBlocksParsed(true); |
|
| 39 | |||
| 40 | return true; |
||
| 41 | } |
||
| 42 | } |
||
| 43 |