public function not($selector)
{
$found = new \SplObjectStorage();
if ($selector instanceof \DOMElement) {
foreach ($this->matches as $m) {
if ($m !== $selector) {
$found->attach($m);
}
}
} elseif (is_array($selector)) {
foreach ($this->matches as $m) {
if (!in_array($m, $selector, true)) {
$found->attach($m);
}
}
} elseif ($selector instanceof \SplObjectStorage) {
foreach ($this->matches as $m) {
if ($selector->contains($m)) {
$found->attach($m);
}
}
} else {
foreach ($this->matches as $m) {
if (!QueryPath::with($m, null, $this->options)->is($selector)) {
$found->attach($m);
}
}
}
return $this->inst($found, null, $this->options);
}