| Conditions | 5 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 24 | private function notElement($css, $xpath, $element) { |
||
| 25 | |||
| 26 | foreach ($css as $selector) { |
||
| 27 | $tokenizer = new \Transphporm\Parser\Tokenizer($selector); |
||
| 28 | $xpathString = $this->cssToXpath->getXpath($tokenizer->getTokens()); |
||
| 29 | $pseudo = $this->cssToXpath->getPseudo($tokenizer->getTokens()); |
||
| 30 | $pseudoMatcher = $this->config->createPseudoMatcher($pseudo); |
||
| 31 | //Find all nodes matched by the expressions in the brackets :not(EXPR) |
||
| 32 | foreach ($xpath->query($xpathString) as $matchedElement) { |
||
| 33 | //Check to see whether this node was matched by the not query |
||
| 34 | if ($pseudoMatcher->matches($matchedElement) && $element->isSameNode($matchedElement)) return false; |
||
| 35 | } |
||
| 36 | } |
||
| 37 | return true; |
||
| 38 | } |
||
| 39 | } |
||
| 40 |