getDocumentIterator()->isEmpty()) { $this->logger->warning('The code-block has no content. Did you properly indent the code? ', $blockContext->getLoggerInformation()); return null; } $node = new CodeNode( $blockContext->getDocumentIterator()->toArray(), ); if (trim($directive->getData()) !== '') { $node->setLanguage(trim($directive->getData())); } else { $node->setLanguage($blockContext->getDocumentParserContext()->getCodeBlockDefaultLanguage()); } $this->codeNodeOptionMapper->apply($node, $directive->getOptions(), $blockContext); if ($directive->getVariable() !== '') { $document = $blockContext->getDocumentParserContext()->getDocument(); $document->addVariable($directive->getVariable(), $node); return null; } return $node; } }