PHP 클래스 Thunder\Shortcode\Processor\Processor

저자: Tomasz Kowalczyk ([email protected])
상속: implements Thunder\Shortcode\Processor\ProcessorInterface
파일 보기 프로젝트 열기: thunderer/shortcode 1 사용 예제들

공개 메소드들

메소드 설명
__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