Copied!
CloneableInstantiable
Methods
public static clearCompiledCache() : void
 
  • internal Used by tests to isolate selector cache state between cases.
public static toXPath(string $selector, bool $ignoreCssSelectorErrors = false, bool $isForHtml = true) : string
 
  • param string $selector
  • param bool $ignoreCssSelectorErrors <p> Ignore css selector errors and use the $selector as it is on error, so that you can also use xPath selectors.
  • param bool $isForHtml
  • return string
Properties
protected static $compiled = ['[".language-php",false,true]' => 'descendant-or-self::*[@class and contains(concat(' ', normalize-space(@class), ' '), ' language-php ')]']
 
  • var string[]
  • phpstan-var array<string,string>
Constants
private voku\helper\SelectorConverter::ADJACENT_SIBLING_COMBINATOR = '+'
private voku\helper\SelectorConverter::CHILD_COMBINATOR = '>'
private voku\helper\SelectorConverter::DESCENDANT_OR_SELF_AXIS_PREFIX = 'descendant-or-self::'
private voku\helper\SelectorConverter::GENERAL_SIBLING_COMBINATOR = '~'
private voku\helper\SelectorConverter::LEADING_COMBINATORS = ['>', '+', '~']
private voku\helper\SelectorConverter::SELECTOR_WHITESPACE_CHARACTERS = ' '
Methods
private static appendNodeTestToXPath(string $prefixXPath, string $innerCombinator, string $nodeTest) : string
 

Appends a node-test XPath suffix to an already-converted prefix XPath expression, using the given inner combinator to determine the axis relationship.

  • param string $prefixXPath XPath for the prefix (e.g. "descendant-or-self::div")
  • param string $innerCombinator One of '>', '+', '~', or '' (empty = descendant/space)
  • param string $nodeTest The node-test, e.g. "text()" or "comment()"
  • return string
private static convertSelectorGroupToXPath(string $selectorGroup, Symfony\Component\CssSelector\CssSelectorConverter $converter) : string
private static convertSelectorListToXPath(string $selector, Symfony\Component\CssSelector\CssSelectorConverter $converter) : string
private static createCompiledCacheKey(string $selector, bool $ignoreCssSelectorErrors, bool $isForHtml) : string
private static createElementAxisPrefix(string $combinator) : string
private static createNodeTestXPath(string $combinator, string $nodeTest) : string
private static parseTrailingNodeTestSelector(string $selector) : ?array
 
  • return array{prefixSelector: string, combinator: string, nodeTest: string}|null
private static replaceLeadingAxis(string $xPathQuery, string $replacement) : string
private static splitSelectorGroups(string $selector) : array
 
  • return string[]
Properties
protected static $compiled = ['[".language-php",false,true]' => 'descendant-or-self::*[@class and contains(concat(' ', normalize-space(@class), ' '), ' language-php ')]']
 
  • var string[]
  • phpstan-var array<string,string>
Methods
private static appendNodeTestToXPath(string $prefixXPath, string $innerCombinator, string $nodeTest) : string
 

Appends a node-test XPath suffix to an already-converted prefix XPath expression, using the given inner combinator to determine the axis relationship.

  • param string $prefixXPath XPath for the prefix (e.g. "descendant-or-self::div")
  • param string $innerCombinator One of '>', '+', '~', or '' (empty = descendant/space)
  • param string $nodeTest The node-test, e.g. "text()" or "comment()"
  • return string
public static clearCompiledCache() : void
 
  • internal Used by tests to isolate selector cache state between cases.
private static convertSelectorGroupToXPath(string $selectorGroup, Symfony\Component\CssSelector\CssSelectorConverter $converter) : string
private static convertSelectorListToXPath(string $selector, Symfony\Component\CssSelector\CssSelectorConverter $converter) : string
private static createCompiledCacheKey(string $selector, bool $ignoreCssSelectorErrors, bool $isForHtml) : string
private static createElementAxisPrefix(string $combinator) : string
private static createNodeTestXPath(string $combinator, string $nodeTest) : string
private static parseTrailingNodeTestSelector(string $selector) : ?array
 
  • return array{prefixSelector: string, combinator: string, nodeTest: string}|null
private static replaceLeadingAxis(string $xPathQuery, string $replacement) : string
private static splitSelectorGroups(string $selector) : array
 
  • return string[]
public static toXPath(string $selector, bool $ignoreCssSelectorErrors = false, bool $isForHtml = true) : string
 
  • param string $selector
  • param bool $ignoreCssSelectorErrors <p> Ignore css selector errors and use the $selector as it is on error, so that you can also use xPath selectors.
  • param bool $isForHtml
  • return string
© 2026 Bruce Wells
Search Namespaces \ Classes
Configuration