Documentation

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

$extensionsInitialized

private bool $extensionsInitialized = false

$inlineParserCharacterRegex

private string $inlineParserCharacterRegex

$listeners

private array<string, PrioritizedList<string|int, callable>> $listeners = []

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

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

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

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

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
throws
RuntimeException
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
phpstan-template

T

phpstan-param

array<string, PrioritizedList> $list

phpstan-param

string $class

phpstan-param

class-string $type

phpstan-return

iterable

Return values
iteratable<string|int, mixed>

initializeExtensions()

private initializeExtensions() : void
Return values
void

injectEnvironmentAndConfigurationIfNeeded()

private injectEnvironmentAndConfigurationIfNeeded(object $object) : void
Parameters
$object : object
Return values
void

Search results