You are here

class NegationNode in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/css-selector/Node/NegationNode.php \Symfony\Component\CssSelector\Node\NegationNode

Represents a "<selector>:not(<identifier>)" node.

This component is a port of the Python cssselect library, which is copyright Ian Bicking, @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>

Hierarchy

Expanded class hierarchy of NegationNode

See also

https://github.com/SimonSapin/cssselect.

1 file declares its use of NegationNode
NegationNodeTest.php in vendor/symfony/css-selector/Tests/Node/NegationNodeTest.php

File

vendor/symfony/css-selector/Node/NegationNode.php, line 22

Namespace

Symfony\Component\CssSelector\Node
View source
class NegationNode extends AbstractNode {

  /**
   * @var NodeInterface
   */
  private $selector;

  /**
   * @var NodeInterface
   */
  private $subSelector;

  /**
   * @param NodeInterface $selector
   * @param NodeInterface $subSelector
   */
  public function __construct(NodeInterface $selector, NodeInterface $subSelector) {
    $this->selector = $selector;
    $this->subSelector = $subSelector;
  }

  /**
   * @return NodeInterface
   */
  public function getSelector() {
    return $this->selector;
  }

  /**
   * @return NodeInterface
   */
  public function getSubSelector() {
    return $this->subSelector;
  }

  /**
   * {@inheritdoc}
   */
  public function getSpecificity() {
    return $this->selector
      ->getSpecificity()
      ->plus($this->subSelector
      ->getSpecificity());
  }

  /**
   * {@inheritdoc}
   */
  public function __toString() {
    return sprintf('%s[%s:not(%s)]', $this
      ->getNodeName(), $this->selector, $this->subSelector);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AbstractNode::$nodeName private property
AbstractNode::getNodeName public function Overrides NodeInterface::getNodeName
NegationNode::$selector private property
NegationNode::$subSelector private property
NegationNode::getSelector public function
NegationNode::getSpecificity public function Returns node's specificity. Overrides NodeInterface::getSpecificity
NegationNode::getSubSelector public function
NegationNode::__construct public function
NegationNode::__toString public function Returns node's string representation. Overrides NodeInterface::__toString