translateScopePseudo example


class PseudoClassExtension extends AbstractExtension
{
    public function getPseudoClassTranslators(): array
    {
        return [
            'root' => $this->translateRoot(...),
            'scope' => $this->translateScopePseudo(...),
            'first-child' => $this->translateFirstChild(...),
            'last-child' => $this->translateLastChild(...),
            'first-of-type' => $this->translateFirstOfType(...),
            'last-of-type' => $this->translateLastOfType(...),
            'only-child' => $this->translateOnlyChild(...),
            'only-of-type' => $this->translateOnlyOfType(...),
            'empty' => $this->translateEmpty(...),
        ];
    }

    public function translateRoot(XPathExpr $xpath): XPathExpr
    {
Home | Imprint | This part of the site doesn't use cookies.