| Conditions | 4 |
| Paths | 4 |
| Total Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 4.0466 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 30 | public function parse(InlineParserContext $inlineContext): bool |
|
| 30 | { |
||
| 31 | 30 | $container = $inlineContext->getContainer(); |
|
| 32 | 30 | $cursor = $inlineContext->getCursor(); |
|
| 33 | 30 | $nextChar = $cursor->peek(); |
|
| 34 | 30 | if ($nextChar !== '^') { |
|
| 35 | 18 | return false; |
|
| 36 | } |
||
| 37 | |||
| 38 | 18 | $state = $cursor->saveState(); |
|
| 39 | |||
| 40 | 18 | $m = $cursor->match('#\[\^([^\]]+)\]#'); |
|
| 41 | 18 | if ($m !== null) { |
|
| 42 | 18 | if (\preg_match('#\[\^([^\]]+)\]#', $m, $matches) > 0) { |
|
| 43 | 18 | $container->appendChild(new FootnoteRef($this->createReference($matches[1]))); |
|
| 44 | |||
| 45 | 18 | return true; |
|
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 49 | $cursor->restoreState($state); |
||
| 50 | |||
| 51 | return false; |
||
| 52 | } |
||
| 53 | |||
| 59 |