Environment
in package
implements
ConfigurableEnvironmentInterface
Interfaces, Classes and Traits
- ConfigurableEnvironmentInterface
- Interface for an Environment which can be configured with config settings, parsers, processors, and renderers
Table of Contents
- $blockParsers : PrioritizedList<string|int, BlockParserInterface>
- $blockRenderersByClass : array<string, PrioritizedList<string|int, BlockRendererInterface>>
- $config : Configuration
- $delimiterProcessors : DelimiterProcessorCollection
- $extensions : array<string|int, ExtensionInterface>
- $extensionsInitialized : bool
- $inlineParserCharacterRegex : string
- $inlineParsers : PrioritizedList<string|int, InlineParserInterface>
- $inlineParsersByCharacter : array<string, PrioritizedList<string|int, InlineParserInterface>>
- $inlineRenderersByClass : array<string, PrioritizedList<string|int, InlineRendererInterface>>
- $listeners : array<string, PrioritizedList<string|int, callable>>
- $uninitializedExtensions : array<string|int, ExtensionInterface>
- __construct() : mixed
- addBlockParser() : self
- Registers the given block parser with the Environment
- addBlockRenderer() : self
- addDelimiterProcessor() : ConfigurableEnvironmentInterface
- Registers the given delimiter processor with the Environment
- addEventListener() : self
- Registers the given event listener
- addExtension() : $this
- Add a single extension
- addInlineParser() : self
- Registers the given inline parser with the Environment
- addInlineRenderer() : self
- Registers the given inline renderer with the Environment
- createCommonMarkEnvironment() : ConfigurableEnvironmentInterface
- createGFMEnvironment() : ConfigurableEnvironmentInterface
- dispatch() : void
- getBlockParsers() : iteratable<string|int, mixed>
- getBlockRenderersForClass() : iteratable<string|int, mixed>
- getConfig() : mixed
- getDelimiterProcessors() : DelimiterProcessorCollection
- getExtensions() : array<string|int, ExtensionInterface>
- Get all registered extensions
- getInlineParserCharacterRegex() : string
- getInlineParsersForCharacter() : iteratable<string|int, mixed>
- getInlineRenderersForClass() : iteratable<string|int, mixed>
- mergeConfig() : void
- setConfig() : void
- assertUninitialized() : void
- buildInlineParserCharacterRegex() : void
- getRenderersByClass() : iteratable<string|int, mixed>
- initializeExtensions() : void
- injectEnvironmentAndConfigurationIfNeeded() : void
Properties
$blockParsers
private
PrioritizedList<string|int, BlockParserInterface>
$blockParsers
$blockRenderersByClass
private
array<string, PrioritizedList<string|int, BlockRendererInterface>>
$blockRenderersByClass
= []
$config
private
Configuration
$config
$delimiterProcessors
private
DelimiterProcessorCollection
$delimiterProcessors
$extensions
private
array<string|int, ExtensionInterface>
$extensions
= []
$extensionsInitialized
private
bool
$extensionsInitialized
= false
$inlineParserCharacterRegex
private
string
$inlineParserCharacterRegex
$inlineParsers
private
PrioritizedList<string|int, InlineParserInterface>
$inlineParsers
$inlineParsersByCharacter
private
array<string, PrioritizedList<string|int, InlineParserInterface>>
$inlineParsersByCharacter
= []
$inlineRenderersByClass
private
array<string, PrioritizedList<string|int, InlineRendererInterface>>
$inlineRenderersByClass
= []
$listeners
private
array<string, PrioritizedList<string|int, callable>>
$listeners
= []
$uninitializedExtensions
private
array<string|int, ExtensionInterface>
$uninitializedExtensions
= []
Methods
__construct()
public
__construct([array<string, mixed> $config = [] ]) : mixed
Parameters
- $config : array<string, mixed> = []
Return values
mixed —addBlockParser()
Registers the given block parser with the Environment
public
addBlockParser(BlockParserInterface $parser, int $priority) : self
Parameters
- $parser : BlockParserInterface
-
Block parser instance
- $priority : int
-
Priority (a higher number will be executed earlier)
Return values
self —addBlockRenderer()
public
addBlockRenderer(mixed $blockClass, BlockRendererInterface $blockRenderer, int $priority) : self
Parameters
- $blockClass : mixed
-
The fully-qualified block element class name the renderer below should handle
- $blockRenderer : BlockRendererInterface
-
The renderer responsible for rendering the type of element given above
- $priority : int
-
Priority (a higher number will be executed earlier)
Return values
self —addDelimiterProcessor()
Registers the given delimiter processor with the Environment
public
addDelimiterProcessor(DelimiterProcessorInterface $processor) : ConfigurableEnvironmentInterface
Parameters
- $processor : DelimiterProcessorInterface
-
Delimiter processors instance
Return values
ConfigurableEnvironmentInterface —addEventListener()
Registers the given event listener
public
addEventListener(string $eventClass, callable $listener, int $priority) : self
Parameters
- $eventClass : string
-
Fully-qualified class name of the event this listener should respond to
- $listener : callable
-
Listener to be executed
- $priority : int
-
Priority (a higher number will be executed earlier)
Return values
self —addExtension()
Add a single extension
public
addExtension(ExtensionInterface $extension) : $this
Parameters
- $extension : ExtensionInterface
Return values
$this —addInlineParser()
Registers the given inline parser with the Environment
public
addInlineParser(InlineParserInterface $parser, int $priority) : self
Parameters
- $parser : InlineParserInterface
-
Inline parser instance
- $priority : int
-
Priority (a higher number will be executed earlier)
Return values
self —addInlineRenderer()
Registers the given inline renderer with the Environment
public
addInlineRenderer(string $inlineClass, InlineRendererInterface $renderer, int $priority) : self
Parameters
- $inlineClass : string
-
The fully-qualified inline element class name the renderer below should handle
- $renderer : InlineRendererInterface
-
The renderer responsible for rendering the type of element given above
- $priority : int
-
Priority (a higher number will be executed earlier)
Return values
self —createCommonMarkEnvironment()
public
static createCommonMarkEnvironment() : ConfigurableEnvironmentInterface
Return values
ConfigurableEnvironmentInterface —createGFMEnvironment()
public
static createGFMEnvironment() : ConfigurableEnvironmentInterface
Return values
ConfigurableEnvironmentInterface —dispatch()
public
dispatch(AbstractEvent $event) : void
Parameters
- $event : AbstractEvent
Return values
void —getBlockParsers()
public
getBlockParsers() : iteratable<string|int, mixed>
Return values
iteratable<string|int, mixed> —getBlockRenderersForClass()
public
getBlockRenderersForClass(string $blockClass) : iteratable<string|int, mixed>
Parameters
- $blockClass : string
Return values
iteratable<string|int, mixed> —getConfig()
public
getConfig([mixed $key = null ][, mixed $default = null ]) : mixed
Parameters
- $key : mixed = null
- $default : mixed = null
Return values
mixed —getDelimiterProcessors()
public
getDelimiterProcessors() : DelimiterProcessorCollection
Return values
DelimiterProcessorCollection —getExtensions()
Get all registered extensions
public
getExtensions() : array<string|int, ExtensionInterface>
Return values
array<string|int, ExtensionInterface> —getInlineParserCharacterRegex()
public
getInlineParserCharacterRegex() : string
Return values
string —getInlineParsersForCharacter()
public
getInlineParsersForCharacter(string $character) : iteratable<string|int, mixed>
Parameters
- $character : string
Return values
iteratable<string|int, mixed> —getInlineRenderersForClass()
public
getInlineRenderersForClass(string $inlineClass) : iteratable<string|int, mixed>
Parameters
- $inlineClass : string
Return values
iteratable<string|int, mixed> —mergeConfig()
public
mergeConfig([array<string|int, mixed> $config = [] ]) : void
Parameters
- $config : array<string|int, mixed> = []
Return values
void —setConfig()
public
setConfig([array<string|int, mixed> $config = [] ]) : void
Parameters
- $config : array<string|int, mixed> = []
Return values
void —assertUninitialized()
private
assertUninitialized(string $message) : void
Parameters
- $message : string
Tags
Return values
void —buildInlineParserCharacterRegex()
private
buildInlineParserCharacterRegex() : void
Return values
void —getRenderersByClass()
private
getRenderersByClass(array<string, PrioritizedList> &$list, string $class, string $type) : iteratable<string|int, mixed>
Parameters
- $list : array<string, PrioritizedList>
- $class : string
- $type : string
Tags
Return values
iteratable<string|int, mixed> —initializeExtensions()
private
initializeExtensions() : void
Return values
void —injectEnvironmentAndConfigurationIfNeeded()
private
injectEnvironmentAndConfigurationIfNeeded(object $object) : void
Parameters
- $object : object