Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | 6 | public function __invoke(DocumentRenderedEvent $event): void |
|
22 | { |
||
23 | 6 | $frontMatter = $event->getOutput()->getDocument()->getData('front_matter'); |
|
24 | 6 | if ($frontMatter === null) { |
|
25 | 3 | return; |
|
26 | } |
||
27 | |||
28 | 3 | $event->replaceOutput(new RenderedContentWithFrontMatter( |
|
29 | 3 | $event->getOutput()->getDocument(), |
|
30 | 3 | $event->getOutput()->getContent(), |
|
31 | 1 | $frontMatter |
|
32 | )); |
||
35 |