Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | public function match($pseudo, \DomElement $element) { |
||
11 | if (strpos($pseudo, 'nth-child') === 0) { |
||
12 | $bracketMatcher = new \Transphporm\Parser\BracketMatcher($pseudo); |
||
13 | $criteria = $bracketMatcher->match('(', ')'); |
||
14 | |||
15 | $bracketMatcher = new \Transphporm\Parser\BracketMatcher($element->getNodePath()); |
||
16 | $num = $bracketMatcher->match('[', ']'); |
||
17 | |||
18 | if (is_callable([$this, $criteria])) return $this->$criteria($num); |
||
19 | else return $num == $criteria; |
||
20 | } |
||
21 | return true; |
||
22 | } |
||
23 | |||
31 | } |