Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 3 | ||
Bugs | 0 | Features | 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 | 5 | if (empty($attributes)) { |
|
26 | 4 | return false; |
|
27 | } |
||
28 | |||
29 | 5 | if (null !== $cursor->getFirstNonSpaceCharacter()) { |
|
30 | 3 | $cursor->restoreState($state); |
|
31 | |||
32 | 3 | return false; |
|
33 | } |
||
34 | |||
35 | 5 | $context->addBlock(new Attributes($attributes)); |
|
36 | 5 | $context->setBlocksParsed(true); |
|
37 | |||
38 | 5 | return true; |
|
39 | } |
||
40 | } |
||
41 |