PHP Class League\CommonMark\Environment

Datei anzeigen Open project: colinodell/commonmark-php Class Usage Examples

Protected Properties

Property Type Description
$blockParsers League\CommonMark\Block\Parser\BlockParserInterface[]
$blockRenderersByClass League\CommonMark\Block\Renderer\BlockRendererInterface[]
$config League\CommonMark\Util\Configuration
$documentProcessors League\CommonMark\DocumentProcessorInterface[]
$extensions League\CommonMark\Extension\ExtensionInterface[]
$extensionsInitialized boolean
$inlineParserCharacterRegex string
$inlineParsers League\CommonMark\Inline\Parser\InlineParserInterface[]
$inlineParsersByCharacter array
$inlineProcessors League\CommonMark\Inline\Processor\InlineProcessorInterface[]
$inlineRenderersByClass League\CommonMark\Inline\Renderer\InlineRendererInterface[]

Public Methods

Method Description
__construct ( array $config = [] )
addBlockParser ( League\CommonMark\Block\Parser\BlockParserInterface $parser )
addBlockRenderer ( string $blockClass, League\CommonMark\Block\Renderer\BlockRendererInterface $blockRenderer )
addDocumentProcessor ( League\CommonMark\DocumentProcessorInterface $processor )
addExtension ( League\CommonMark\Extension\ExtensionInterface $extension ) Add a single extension
addInlineParser ( League\CommonMark\Inline\Parser\InlineParserInterface $parser )
addInlineProcessor ( League\CommonMark\Inline\Processor\InlineProcessorInterface $processor )
addInlineRenderer ( string $inlineClass, League\CommonMark\Inline\Renderer\InlineRendererInterface $renderer )
createCommonMarkEnvironment ( ) : Environment
createInlineParserEngine ( )
getBlockParsers ( ) : League\CommonMark\Block\Parser\BlockParserInterface[]
getBlockRendererForClass ( string $blockClass ) : League\CommonMark\Block\Renderer\BlockRendererInterface | null
getConfig ( string | null $key = null, mixed $default = null ) : mixed
getDocumentProcessors ( ) : League\CommonMark\DocumentProcessorInterface[]
getExtensions ( ) : League\CommonMark\Extension\ExtensionInterface[] Get all registered extensions
getInlineParser ( string $name ) : League\CommonMark\Inline\Parser\InlineParserInterface
getInlineParserCharacterRegex ( ) : string Regex which matches any character which doesn't indicate an inline element
getInlineParsers ( ) : League\CommonMark\Inline\Parser\InlineParserInterface[]
getInlineParsersForCharacter ( string $character ) : League\CommonMark\Inline\Parser\InlineParserInterface[] | null
getInlineProcessors ( ) : League\CommonMark\Inline\Processor\InlineProcessorInterface[]
getInlineRendererForClass ( string $inlineClass ) : League\CommonMark\Inline\Renderer\InlineRendererInterface | null
mergeConfig ( array $config = [] )
setConfig ( array $config = [] )

Protected Methods

Method Description
initializeExtension ( League\CommonMark\Extension\ExtensionInterface $extension )
initializeExtensions ( )

Private Methods

Method Description
assertUninitialized ( string $message )
buildInlineParserCharacterRegex ( )
getMiscExtension ( ) : MiscExtension
initalizeBlockParsers ( League\CommonMark\Block\Parser\BlockParserInterface[] $blockParsers )
initializeBlockRenderers ( League\CommonMark\Block\Renderer\BlockRendererInterface[] $blockRenderers )
initializeDocumentProcessors ( League\CommonMark\DocumentProcessorInterface[] $documentProcessors )
initializeInlineParsers ( League\CommonMark\Inline\Parser\InlineParserInterface[] $inlineParsers )
initializeInlineProcessors ( League\CommonMark\Inline\Processor\InlineProcessorInterface[] $inlineProcessors )
initializeInlineRenderers ( League\CommonMark\Inline\Renderer\InlineRendererInterface[] $inlineRenderers )

Method Details

__construct() public method

public __construct ( array $config = [] )
$config array

addBlockParser() public method

public addBlockParser ( League\CommonMark\Block\Parser\BlockParserInterface $parser )
$parser League\CommonMark\Block\Parser\BlockParserInterface

addBlockRenderer() public method

public addBlockRenderer ( string $blockClass, League\CommonMark\Block\Renderer\BlockRendererInterface $blockRenderer )
$blockClass string
$blockRenderer League\CommonMark\Block\Renderer\BlockRendererInterface

addDocumentProcessor() public method

public addDocumentProcessor ( League\CommonMark\DocumentProcessorInterface $processor )
$processor League\CommonMark\DocumentProcessorInterface

addExtension() public method

Add a single extension
public addExtension ( League\CommonMark\Extension\ExtensionInterface $extension )
$extension League\CommonMark\Extension\ExtensionInterface

addInlineParser() public method

public addInlineParser ( League\CommonMark\Inline\Parser\InlineParserInterface $parser )
$parser League\CommonMark\Inline\Parser\InlineParserInterface

addInlineProcessor() public method

public addInlineProcessor ( League\CommonMark\Inline\Processor\InlineProcessorInterface $processor )
$processor League\CommonMark\Inline\Processor\InlineProcessorInterface

addInlineRenderer() public method

public addInlineRenderer ( string $inlineClass, League\CommonMark\Inline\Renderer\InlineRendererInterface $renderer )
$inlineClass string
$renderer League\CommonMark\Inline\Renderer\InlineRendererInterface

createCommonMarkEnvironment() public static method

public static createCommonMarkEnvironment ( ) : Environment
return Environment

createInlineParserEngine() public method

getBlockParsers() public method

public getBlockParsers ( ) : League\CommonMark\Block\Parser\BlockParserInterface[]
return League\CommonMark\Block\Parser\BlockParserInterface[]

getBlockRendererForClass() public method

public getBlockRendererForClass ( string $blockClass ) : League\CommonMark\Block\Renderer\BlockRendererInterface | null
$blockClass string
return League\CommonMark\Block\Renderer\BlockRendererInterface | null

getConfig() public method

public getConfig ( string | null $key = null, mixed $default = null ) : mixed
$key string | null
$default mixed
return mixed

getDocumentProcessors() public method

public getDocumentProcessors ( ) : League\CommonMark\DocumentProcessorInterface[]
return League\CommonMark\DocumentProcessorInterface[]

getExtensions() public method

Get all registered extensions
public getExtensions ( ) : League\CommonMark\Extension\ExtensionInterface[]
return League\CommonMark\Extension\ExtensionInterface[]

getInlineParser() public method

public getInlineParser ( string $name ) : League\CommonMark\Inline\Parser\InlineParserInterface
$name string
return League\CommonMark\Inline\Parser\InlineParserInterface

getInlineParserCharacterRegex() public method

This allows us to parse multiple non-special characters at once

getInlineParsers() public method

public getInlineParsers ( ) : League\CommonMark\Inline\Parser\InlineParserInterface[]
return League\CommonMark\Inline\Parser\InlineParserInterface[]

getInlineParsersForCharacter() public method

public getInlineParsersForCharacter ( string $character ) : League\CommonMark\Inline\Parser\InlineParserInterface[] | null
$character string
return League\CommonMark\Inline\Parser\InlineParserInterface[] | null

getInlineProcessors() public method

public getInlineProcessors ( ) : League\CommonMark\Inline\Processor\InlineProcessorInterface[]
return League\CommonMark\Inline\Processor\InlineProcessorInterface[]

getInlineRendererForClass() public method

public getInlineRendererForClass ( string $inlineClass ) : League\CommonMark\Inline\Renderer\InlineRendererInterface | null
$inlineClass string
return League\CommonMark\Inline\Renderer\InlineRendererInterface | null

initializeExtension() protected method

protected initializeExtension ( League\CommonMark\Extension\ExtensionInterface $extension )
$extension League\CommonMark\Extension\ExtensionInterface

initializeExtensions() protected method

protected initializeExtensions ( )

mergeConfig() public method

public mergeConfig ( array $config = [] )
$config array

setConfig() public method

public setConfig ( array $config = [] )
$config array

Property Details

$blockParsers protected_oe property

protected BlockParserInterface[],League\CommonMark\Block\Parser $blockParsers
return League\CommonMark\Block\Parser\BlockParserInterface[]

$blockRenderersByClass protected_oe property

protected BlockRendererInterface[],League\CommonMark\Block\Renderer $blockRenderersByClass
return League\CommonMark\Block\Renderer\BlockRendererInterface[]

$config protected_oe property

protected Configuration,League\CommonMark\Util $config
return League\CommonMark\Util\Configuration

$documentProcessors protected_oe property

protected DocumentProcessorInterface[],League\CommonMark $documentProcessors
return League\CommonMark\DocumentProcessorInterface[]

$extensions protected_oe property

protected ExtensionInterface[],League\CommonMark\Extension $extensions
return League\CommonMark\Extension\ExtensionInterface[]

$extensionsInitialized protected_oe property

protected bool $extensionsInitialized
return boolean

$inlineParserCharacterRegex protected_oe property

protected string $inlineParserCharacterRegex
return string

$inlineParsers protected_oe property

protected InlineParserInterface[],League\CommonMark\Inline\Parser $inlineParsers
return League\CommonMark\Inline\Parser\InlineParserInterface[]

$inlineParsersByCharacter protected_oe property

protected array $inlineParsersByCharacter
return array

$inlineProcessors protected_oe property

protected InlineProcessorInterface[],League\CommonMark\Inline\Processor $inlineProcessors
return League\CommonMark\Inline\Processor\InlineProcessorInterface[]

$inlineRenderersByClass protected_oe property

protected InlineRendererInterface[],League\CommonMark\Inline\Renderer $inlineRenderersByClass
return League\CommonMark\Inline\Renderer\InlineRendererInterface[]