You are here

public function Translator::addPseudoClass in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/css-selector/XPath/Translator.php \Symfony\Component\CssSelector\XPath\Translator::addPseudoClass()

Parameters

XPathExpr $xpath:

string $pseudoClass:

Return value

XPathExpr

Throws

ExpressionErrorException

File

vendor/symfony/css-selector/XPath/Translator.php, line 254

Class

Translator
XPath expression translator interface.

Namespace

Symfony\Component\CssSelector\XPath

Code

public function addPseudoClass(XPathExpr $xpath, $pseudoClass) {
  if (!isset($this->pseudoClassTranslators[$pseudoClass])) {
    throw new ExpressionErrorException(sprintf('Pseudo-class "%s" not supported.', $pseudoClass));
  }
  return call_user_func($this->pseudoClassTranslators[$pseudoClass], $xpath);
}