class SelectorNode in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/css-selector/Node/SelectorNode.php \Symfony\Component\CssSelector\Node\SelectorNode
Represents a "<selector>(::|:)<pseudoElement>" 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
- class \Symfony\Component\CssSelector\Node\AbstractNode implements NodeInterface
- class \Symfony\Component\CssSelector\Node\SelectorNode
Expanded class hierarchy of SelectorNode
See also
https://github.com/SimonSapin/cssselect.
13 files declare their use of SelectorNode
- ClassParser.php in vendor/
symfony/ css-selector/ Parser/ Shortcut/ ClassParser.php - ClassParserTest.php in vendor/
symfony/ css-selector/ Tests/ Parser/ Shortcut/ ClassParserTest.php - ElementParser.php in vendor/
symfony/ css-selector/ Parser/ Shortcut/ ElementParser.php - ElementParserTest.php in vendor/
symfony/ css-selector/ Tests/ Parser/ Shortcut/ ElementParserTest.php - EmptyStringParser.php in vendor/
symfony/ css-selector/ Parser/ Shortcut/ EmptyStringParser.php
File
- vendor/
symfony/ css-selector/ Node/ SelectorNode.php, line 22
Namespace
Symfony\Component\CssSelector\NodeView source
class SelectorNode extends AbstractNode {
/**
* @var NodeInterface
*/
private $tree;
/**
* @var null|string
*/
private $pseudoElement;
/**
* @param NodeInterface $tree
* @param null|string $pseudoElement
*/
public function __construct(NodeInterface $tree, $pseudoElement = null) {
$this->tree = $tree;
$this->pseudoElement = $pseudoElement ? strtolower($pseudoElement) : null;
}
/**
* @return NodeInterface
*/
public function getTree() {
return $this->tree;
}
/**
* @return null|string
*/
public function getPseudoElement() {
return $this->pseudoElement;
}
/**
* {@inheritdoc}
*/
public function getSpecificity() {
return $this->tree
->getSpecificity()
->plus(new Specificity(0, 0, $this->pseudoElement ? 1 : 0));
}
/**
* {@inheritdoc}
*/
public function __toString() {
return sprintf('%s[%s%s]', $this
->getNodeName(), $this->tree, $this->pseudoElement ? '::' . $this->pseudoElement : '');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AbstractNode:: |
private | property | ||
AbstractNode:: |
public | function |
Overrides NodeInterface:: |
|
SelectorNode:: |
private | property | ||
SelectorNode:: |
private | property | ||
SelectorNode:: |
public | function | ||
SelectorNode:: |
public | function |
Returns node's specificity. Overrides NodeInterface:: |
|
SelectorNode:: |
public | function | ||
SelectorNode:: |
public | function | ||
SelectorNode:: |
public | function |
Returns node's string representation. Overrides NodeInterface:: |