abstract class TagProcessorBase in Extensible BBCode 4.0.x
Same name and namespace in other branches
- 8.3 src/Parser/Processor/TagProcessorBase.php \Drupal\xbbcode\Parser\Processor\TagProcessorBase
Base tag processor for wrapping the output.
@package Drupal\xbbcode\Parser
Hierarchy
- class \Drupal\xbbcode\Parser\Processor\TagProcessorBase implements TagProcessorInterface
Expanded class hierarchy of TagProcessorBase
File
- src/
Parser/ Processor/ TagProcessorBase.php, line 14
Namespace
Drupal\xbbcode\Parser\ProcessorView source
abstract class TagProcessorBase implements TagProcessorInterface {
/**
* {@inheritdoc}
*/
public function process(TagElementInterface $tag) : OutputElementInterface {
$output = $this
->doProcess($tag);
if (!$output instanceof OutputElementInterface) {
$output = new OutputElement((string) $output);
}
return $output;
}
/**
* Override this function to return any printable value.
*
* @param \Drupal\xbbcode\Parser\Tree\TagElementInterface $tag
* Tag element in the parse tree.
*
* @return mixed
* Any value that can be cast to string.
*/
public abstract function doProcess(TagElementInterface $tag);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TagProcessorBase:: |
abstract public | function | Override this function to return any printable value. | 1 |
TagProcessorBase:: |
public | function |
Process a tag match. Overrides TagProcessorInterface:: |