4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\CssSelector\Node;
15 * Represents a "<selector>:not(<identifier>)" node.
17 * This component is a port of the Python cssselect library,
18 * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
20 * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
24 class NegationNode extends AbstractNode
29 public function __construct(NodeInterface $selector, NodeInterface $subSelector)
31 $this->selector = $selector;
32 $this->subSelector = $subSelector;
36 * @return NodeInterface
38 public function getSelector()
40 return $this->selector;
44 * @return NodeInterface
46 public function getSubSelector()
48 return $this->subSelector;
54 public function getSpecificity()
56 return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity());
62 public function __toString()
64 return sprintf('%s[%s:not(%s)]', $this->getNodeName(), $this->selector, $this->subSelector);