@@ -12,14 +12,14 @@ |
||
12 | 12 | private $depth; |
13 | 13 | |
14 | 14 | public function __construct($css, Value $valueParser, $prefix = '') { |
15 | - $this->css = str_replace([' >', '> '],['>', '>'], trim($css)); |
|
15 | + $this->css = str_replace([' >', '> '], ['>', '>'], trim($css)); |
|
16 | 16 | $this->translators = [ |
17 | - ' ' => function($string) use ($prefix) { return '//' . $prefix . $string; }, |
|
18 | - '' => function($string) use ($prefix) { return '/' . $prefix . $string; }, |
|
19 | - '>' => function($string) use ($prefix) { return '/' . $prefix . $string; }, |
|
20 | - '#' => function($string) { return '[@id=\'' . $string . '\']'; }, |
|
21 | - '.' => function($string) { return '[contains(concat(\' \', normalize-space(@class), \' \'), \' ' . $string . ' \')]'; }, |
|
22 | - '[' => function($string, $xpath) { return '[' .'php:function(\'\Transphporm\Parser\CssToXpath::processAttr\', \'' . $string . '\', .)' . ']'; }, |
|
17 | + ' ' => function($string) use ($prefix) { return '//'.$prefix.$string; }, |
|
18 | + '' => function($string) use ($prefix) { return '/'.$prefix.$string; }, |
|
19 | + '>' => function($string) use ($prefix) { return '/'.$prefix.$string; }, |
|
20 | + '#' => function($string) { return '[@id=\''.$string.'\']'; }, |
|
21 | + '.' => function($string) { return '[contains(concat(\' \', normalize-space(@class), \' \'), \' '.$string.' \')]'; }, |
|
22 | + '[' => function($string, $xpath) { return '['.'php:function(\'\Transphporm\Parser\CssToXpath::processAttr\', \''.$string.'\', .)'.']'; }, |
|
23 | 23 | ']' => function() { return ''; } |
24 | 24 | ]; |
25 | 25 | } |