|
@@ -17,14 +17,14 @@ |
|
|
block discarded – undo |
|
17
|
17
|
public function __construct($css, Value $valueParser, $prefix = '') { |
|
18
|
18
|
$hash = $this->registerInstance(); |
|
19
|
19
|
$this->valueParser = $valueParser; |
|
20
|
|
- $this->css = str_replace([' >', '> '],['>', '>'], trim($css)); |
|
|
20
|
+ $this->css = str_replace([' >', '> '], ['>', '>'], trim($css)); |
|
21
|
21
|
$this->translators = [ |
|
22
|
|
- ' ' => function($string) use ($prefix) { return '//' . $prefix . $string; }, |
|
23
|
|
- '' => function($string) use ($prefix) { return '/' . $prefix . $string; }, |
|
24
|
|
- '>' => function($string) use ($prefix) { return '/' . $prefix . $string; }, |
|
25
|
|
- '#' => function($string) { return '[@id=\'' . $string . '\']'; }, |
|
26
|
|
- '.' => function($string) { return '[contains(concat(\' \', normalize-space(@class), \' \'), \' ' . $string . ' \')]'; }, |
|
27
|
|
- '[' => function($string) use ($hash) { return '[' .'php:function(\'\Transphporm\Parser\CssToXpath::processAttr\', \'' . $string . '\', ., "' . $hash . '")' . ']'; }, |
|
|
22
|
+ ' ' => function($string) use ($prefix) { return '//'.$prefix.$string; }, |
|
|
23
|
+ '' => function($string) use ($prefix) { return '/'.$prefix.$string; }, |
|
|
24
|
+ '>' => function($string) use ($prefix) { return '/'.$prefix.$string; }, |
|
|
25
|
+ '#' => function($string) { return '[@id=\''.$string.'\']'; }, |
|
|
26
|
+ '.' => function($string) { return '[contains(concat(\' \', normalize-space(@class), \' \'), \' '.$string.' \')]'; }, |
|
|
27
|
+ '[' => function($string) use ($hash) { return '['.'php:function(\'\Transphporm\Parser\CssToXpath::processAttr\', \''.$string.'\', ., "'.$hash.'")'.']'; }, |
|
28
|
28
|
']' => function() { return ''; } |
|
29
|
29
|
]; |
|
30
|
30
|
} |