{"record":{"id":"cb7127749d716661","repo":"symfony/css-selector","slug":"combiner-s-not-supported","errorCode":null,"errorMessage":"Combiner \"%s\" not supported.","messagePattern":"Combiner \"(.+?)\" not supported\\.","errorType":"exception","errorClass":"ExpressionErrorException","httpStatus":null,"severity":"error","filePath":"XPath/Translator.php","lineNumber":169,"sourceCode":"    /**\n     * @throws ExpressionErrorException\n     */\n    public function nodeToXPath(NodeInterface $node): XPathExpr\n    {\n        if (!isset($this->nodeTranslators[$node->getNodeName()])) {\n            throw new ExpressionErrorException(\\sprintf('Node \"%s\" not supported.', $node->getNodeName()));\n        }\n\n        return $this->nodeTranslators[$node->getNodeName()]($node, $this);\n    }\n\n    /**\n     * @throws ExpressionErrorException\n     */\n    public function addCombination(string $combiner, NodeInterface $xpath, NodeInterface $combinedXpath): XPathExpr\n    {\n        if (!isset($this->combinationTranslators[$combiner])) {\n            throw new ExpressionErrorException(\\sprintf('Combiner \"%s\" not supported.', $combiner));\n        }\n\n        return $this->combinationTranslators[$combiner]($this->nodeToXPath($xpath), $this->nodeToXPath($combinedXpath));\n    }\n\n    /**\n     * @throws ExpressionErrorException\n     */\n    public function addRelativeCombination(string $combiner, NodeInterface $xpath, NodeInterface $combinedXpath): XPathExpr\n    {\n        if (!isset($this->relativeCombinationTranslators[$combiner])) {\n            throw new ExpressionErrorException(\\sprintf('Combiner \"%s\" not supported.', $combiner));\n        }\n\n        return $this->relativeCombinationTranslators[$combiner]($this->nodeToXPath($xpath), $this->nodeToXPath($combinedXpath));\n    }\n\n    /**","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/symfony/css-selector/blob/08e2905152a39cf3fd1745d83f8c483e258887d9/XPath/Translator.php#L151-L187","documentation":"Translator::addCombination() looks up a combiner (' ', '>', '+', '~') in $this->combinationTranslators and throws ExpressionErrorException when the combiner string is not registered. The public translator maps cover all CSS combinators, so this surfaces almost exclusively when tests or extensions inject an unknown combiner key.","triggerScenarios":"Calling addCombination() with a $combiner string not present in combinationTranslators — e.g. a custom combiner symbol, a typo, or an empty string. As seen in testAddCombinationNotExistsExtension, the documented trigger is invoking the method before/without the matching extension being registered.","commonSituations":"Custom selector extensions defining new combination operators without registering a combination translator; typos when building combined selectors programmatically; test code exercising the error path with fake combiner values.","solutions":["Use only standard CSS combinators: descendant (' '), child ('>'), adjacent sibling ('+'), general sibling ('~').","Register a custom combination translator via an extension added with Translator::extension() before calling addCombination().","Check the exact $combiner string for typos or stray whitespace."],"exampleFix":"// before\n$translator->addCombination('>>', $a, $b); // unknown combiner, throws\n\n// after\n$translator->addCombination('>', $a, $b); // standard child combinator","handlingStrategy":"validation","validationCode":"const VALID_COMBINERS = [' ', '>', '+', '~'];\nif (!in_array($combiner, self::VALID_COMBINERS, true)) {\n    throw new \\InvalidArgumentException(\"Invalid combiner: $combiner\");\n}","typeGuard":null,"tryCatchPattern":"use Symfony\\Component\\CssSelector\\Exception\\ExpressionErrorException;\ntry {\n    $result = $translator->addCombination($combiner, $a, $b);\n} catch (ExpressionErrorException $e) {\n    // fall back to descendant combination ' '\n}","preventionTips":["Restrict combiner inputs to the four standard CSS combinator strings","Whitelist-validate any combiner coming from user or config input","Unit-test custom extensions with an unknown-combiner assertion"],"tags":["css-selector","xpath","combinator","unsupported-operator"],"backgroundTag":"unsupported-enum-value","analyzedSha":"08e2905152a39cf3fd1745d83f8c483e258887d9","analyzedAt":"2026-09-14T11:41:28.509Z","contentChangedAt":"2026-09-14T11:41:28.509Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}