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