Skip to content

Commit 7cdf543

Browse files
committed
Merge branch '2.3' into 2.5
* 2.3: [Routing] add tests for RequestContext [Routing] fix inconsistencies in RequestContext don't raise warnings when exception is thrown
2 parents 12fd0ca + d994338 commit 7cdf543

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

XPath/Translator.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,15 @@ public function cssToXPath($cssExpr, $prefix = 'descendant-or-self::')
123123
$selectors = $this->parseSelectors($cssExpr);
124124

125125
/** @var SelectorNode $selector */
126-
foreach ($selectors as $selector) {
126+
foreach ($selectors as $index => $selector) {
127127
if (null !== $selector->getPseudoElement()) {
128128
throw new ExpressionErrorException('Pseudo-elements are not supported.');
129129
}
130-
}
131130

132-
$translator = $this;
131+
$selectors[$index] = $this->selectorToXPath($selector, $prefix);
132+
}
133133

134-
return implode(' | ', array_map(function (SelectorNode $selector) use ($translator, $prefix) {
135-
return $translator->selectorToXPath($selector, $prefix);
136-
}, $selectors));
134+
return implode(' | ', $selectors);
137135
}
138136

139137
/**

0 commit comments

Comments
 (0)