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
37 * @param NodeInterface $selector
38 * @param NodeInterface $subSelector
40 public function __construct(NodeInterface $selector, NodeInterface $subSelector)
42 $this->selector = $selector;
43 $this->subSelector = $subSelector;
47 * @return NodeInterface
49 public function getSelector()
51 return $this->selector;
55 * @return NodeInterface
57 public function getSubSelector()
59 return $this->subSelector;
65 public function getSpecificity()
67 return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity());
73 public function __toString()
75 return sprintf('%s[%s:not(%s)]', $this->getNodeName(), $this->selector, $this->subSelector);