@@ -7,11 +7,11 @@ discard block |
||
7 | 7 | namespace Transphporm\Pseudo; |
8 | 8 | class Not implements \Transphporm\Pseudo { |
9 | 9 | private $cssToXpath; |
10 | - private $config; |
|
10 | + private $config; |
|
11 | 11 | |
12 | 12 | public function __construct(\Transphporm\Parser\CssToXpath $cssToXpath, \Transphporm\Config $config) { |
13 | 13 | $this->cssToXpath = $cssToXpath; |
14 | - $this->config = $config; |
|
14 | + $this->config = $config; |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | public function match($name, $args, \DomElement $element) { |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | foreach ($css as $selector) { |
27 | 27 | $tokenizer = new \Transphporm\Parser\Tokenizer($selector); |
28 | 28 | $xpathString = $this->cssToXpath->getXpath($tokenizer->getTokens()); |
29 | - $pseudo = $this->cssToXpath->getPseudo($tokenizer->getTokens()); |
|
30 | - $pseudoMatcher = $this->config->createPseudoMatcher($pseudo); |
|
29 | + $pseudo = $this->cssToXpath->getPseudo($tokenizer->getTokens()); |
|
30 | + $pseudoMatcher = $this->config->createPseudoMatcher($pseudo); |
|
31 | 31 | //Find all nodes matched by the expressions in the brackets :not(EXPR) |
32 | 32 | foreach ($xpath->query($xpathString) as $matchedElement) { |
33 | 33 | //Check to see whether this node was matched by the not query |
@@ -15,7 +15,9 @@ discard block |
||
15 | 15 | } |
16 | 16 | |
17 | 17 | public function match($name, $args, \DomElement $element) { |
18 | - if ($name !== 'not') return true; |
|
18 | + if ($name !== 'not') { |
|
19 | + return true; |
|
20 | + } |
|
19 | 21 | |
20 | 22 | $xpath = new \DomXpath($element->ownerDocument); |
21 | 23 | return $this->notElement($args, $xpath, $element); |
@@ -31,7 +33,9 @@ discard block |
||
31 | 33 | //Find all nodes matched by the expressions in the brackets :not(EXPR) |
32 | 34 | foreach ($xpath->query($xpathString) as $matchedElement) { |
33 | 35 | //Check to see whether this node was matched by the not query |
34 | - if ($pseudoMatcher->matches($matchedElement) && $element->isSameNode($matchedElement)) return false; |
|
36 | + if ($pseudoMatcher->matches($matchedElement) && $element->isSameNode($matchedElement)) { |
|
37 | + return false; |
|
38 | + } |
|
35 | 39 | } |
36 | 40 | } |
37 | 41 | return true; |