function PseudoSelector::check
Returns true if the selector part matches the given node, false otherwise
Parameters
Node $parent Parent node:
Return value
bool
Overrides Part::check
File
-
vendor/
mck89/ peast/ lib/ Peast/ Selector/ Node/ Part/ PseudoSelector.php, line 59
Class
- PseudoSelector
- Selector part selector pseudo class
Namespace
Peast\Selector\Node\PartCode
public function check(Node $node, $parent = null) {
$match = new Matches();
$match->addMatch($node, $parent);
$res = $this->selector
->exec($match)
->count();
return $this->name === "not" ? $res === 0 : $res !== 0;
}