/**
* @return $this
*/
public function registerExtension(Extension\ExtensionInterface
$extension):
static { $this->extensions
[$extension->
getName()] =
$extension;
$this->nodeTranslators =
array_merge($this->nodeTranslators,
$extension->
getNodeTranslators());
$this->combinationTranslators =
array_merge($this->combinationTranslators,
$extension->
getCombinationTranslators());
$this->functionTranslators =
array_merge($this->functionTranslators,
$extension->
getFunctionTranslators());
$this->pseudoClassTranslators =
array_merge($this->pseudoClassTranslators,
$extension->
getPseudoClassTranslators());
$this->attributeMatchingTranslators =
array_merge($this->attributeMatchingTranslators,
$extension->
getAttributeMatchingTranslators());
return $this;
} /**
* @throws ExpressionErrorException
*/
public function getExtension(string
$name): Extension\ExtensionInterface
{ if (!
isset($this->extensions
[$name])) { throw new ExpressionErrorException(sprintf('Extension "%s" not registered.',
$name));
}