DefaultCodeNodeOptionMapper
in package
implements
CodeNodeOptionMapper
FinalYes
The directives `code-block` and `literalinclude` both create a CodeNode with the same possible options.
This common mapper is used by both Directives.
Table of Contents
Interfaces
- CodeNodeOptionMapper
- The directives `code-block` and `literalinclude` both create a CodeNode with the same possible options.
Constants
- LINE_NUMBER_RANGES_REGEX = '/^\d+(-\d*)?(?:,\s*\d+(-\d*)?)*$/'
Properties
- $startingRule : InlineMarkupRule
- $inlineParser : InlineParser
- $logger : LoggerInterface
Methods
- __construct() : mixed
- apply() : void
- setCaptionBasedOnOptions() : void
- setEmphasizeLinesBasedOnOptions() : void
- setStartingLineNumberBasedOnOptions() : void
Constants
LINE_NUMBER_RANGES_REGEX
public
mixed
LINE_NUMBER_RANGES_REGEX
= '/^\d+(-\d*)?(?:,\s*\d+(-\d*)?)*$/'
Tags
Properties
$startingRule
protected
InlineMarkupRule
$startingRule
$inlineParser read-only
private
InlineParser
$inlineParser
$logger read-only
private
LoggerInterface
$logger
Methods
__construct()
public
__construct(LoggerInterface $logger, InlineMarkupRule $startingRule, InlineParser $inlineParser) : mixed
Parameters
- $logger : LoggerInterface
- $startingRule : InlineMarkupRule
- $inlineParser : InlineParser
apply()
public
apply(CodeNode $codeNode, array<string|int, DirectiveOption> $directiveOptions, BlockContext $blockContext) : void
Parameters
- $codeNode : CodeNode
- $directiveOptions : array<string|int, DirectiveOption>
- $blockContext : BlockContext
setCaptionBasedOnOptions()
private
setCaptionBasedOnOptions(array<string|int, DirectiveOption> $options, CodeNode $node, BlockContext $blockContext) : void
Parameters
- $options : array<string|int, DirectiveOption>
- $node : CodeNode
- $blockContext : BlockContext
setEmphasizeLinesBasedOnOptions()
private
setEmphasizeLinesBasedOnOptions(array<string|int, DirectiveOption> $options, CodeNode $node, BlockContext $blockContext) : void
Parameters
- $options : array<string|int, DirectiveOption>
- $node : CodeNode
- $blockContext : BlockContext
setStartingLineNumberBasedOnOptions()
private
setStartingLineNumberBasedOnOptions(array<string, DirectiveOption> $options, CodeNode $node) : void
Parameters
- $options : array<string, DirectiveOption>
- $node : CodeNode