Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
26 | 18 | public function parse(ContextInterface $context, Cursor $cursor): bool |
|
27 | { |
||
28 | 18 | $state = $cursor->saveState(); |
|
29 | 18 | $attributes = $this->parseAttributes($cursor); |
|
30 | 18 | if ($attributes === []) { |
|
31 | 15 | return false; |
|
32 | } |
||
33 | |||
34 | 15 | if ($cursor->getNextNonSpaceCharacter() !== null) { |
|
35 | 9 | $cursor->restoreState($state); |
|
36 | |||
37 | 9 | return false; |
|
38 | } |
||
39 | |||
40 | 15 | $context->addBlock(new Attributes($attributes)); |
|
41 | 15 | $context->setBlocksParsed(true); |
|
42 | |||
43 | 15 | return true; |
|
44 | } |
||
45 | } |
||
46 |