PHP Класс Thunder\Shortcode\Processor\Processor

Автор: Tomasz Kowalczyk ([email protected])
Наследование: implements Thunder\Shortcode\Processor\ProcessorInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Thunder\Shortcode\Parser\ParserInterface $parser, Thunder\Shortcode\HandlerContainer\HandlerContainerInterface $handlers ) automatically process shortcode content
process ( string $text ) : string Entry point for shortcode processing. Implements iterative algorithm for both limited and unlimited number of iterations.
withAutoProcessContent ( boolean $flag ) : self Whether shortcode content will be automatically processed and handler already receives shortcode with processed content. If false, every shortcode handler needs to process content on its own. Default true.
withEventContainer ( Thunder\Shortcode\EventContainer\EventContainerInterface $eventContainer ) : self Container for event handlers used in this processor.
withMaxIterations ( integer | null $iterations ) : self Maximum number of iterations, null means infinite, any integer greater than zero sets value. Zero is invalid because there must be at least one iteration. Defaults to 1. Loop breaks if result of two consequent iterations shows no change in processed text.
withRecursionDepth ( integer | null $depth ) : self Recursion depth level, null means infinite, any integer greater than or equal to zero sets value (number of recursion levels). Zero disables recursion. Defaults to null.

Приватные методы

Метод Описание
applyReplaces ( $text, array $replaces )
dispatchEvent ( $name, $event )
processHandler ( Thunder\Shortcode\Shortcode\ParsedShortcodeInterface $parsed, Thunder\Shortcode\Processor\ProcessorContext $context, $handler )
processIteration ( $text, Thunder\Shortcode\Processor\ProcessorContext $context, Thunder\Shortcode\Shortcode\ProcessedShortcode $parent = null )
processRecursion ( Thunder\Shortcode\Shortcode\ParsedShortcodeInterface $shortcode, Thunder\Shortcode\Processor\ProcessorContext $context )

Описание методов

__construct() публичный Метод

automatically process shortcode content
public __construct ( Thunder\Shortcode\Parser\ParserInterface $parser, Thunder\Shortcode\HandlerContainer\HandlerContainerInterface $handlers )
$parser Thunder\Shortcode\Parser\ParserInterface
$handlers Thunder\Shortcode\HandlerContainer\HandlerContainerInterface

process() публичный Метод

Entry point for shortcode processing. Implements iterative algorithm for both limited and unlimited number of iterations.
public process ( string $text ) : string
$text string Text to process
Результат string

withAutoProcessContent() публичный Метод

Whether shortcode content will be automatically processed and handler already receives shortcode with processed content. If false, every shortcode handler needs to process content on its own. Default true.
public withAutoProcessContent ( boolean $flag ) : self
$flag boolean True if enabled (default), false otherwise
Результат self

withEventContainer() публичный Метод

Container for event handlers used in this processor.
public withEventContainer ( Thunder\Shortcode\EventContainer\EventContainerInterface $eventContainer ) : self
$eventContainer Thunder\Shortcode\EventContainer\EventContainerInterface
Результат self

withMaxIterations() публичный Метод

Maximum number of iterations, null means infinite, any integer greater than zero sets value. Zero is invalid because there must be at least one iteration. Defaults to 1. Loop breaks if result of two consequent iterations shows no change in processed text.
public withMaxIterations ( integer | null $iterations ) : self
$iterations integer | null
Результат self

withRecursionDepth() публичный Метод

Recursion depth level, null means infinite, any integer greater than or equal to zero sets value (number of recursion levels). Zero disables recursion. Defaults to null.
public withRecursionDepth ( integer | null $depth ) : self
$depth integer | null
Результат self