class ElementNode
Represents a "<namespace>|<element>" 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>
@internal
Hierarchy
- class \Symfony\Component\CssSelector\Node\AbstractNode implements \Symfony\Component\CssSelector\Node\NodeInterface
- class \Symfony\Component\CssSelector\Node\ElementNode extends \Symfony\Component\CssSelector\Node\AbstractNode
Expanded class hierarchy of ElementNode
See also
https://github.com/SimonSapin/cssselect.
4 files declare their use of ElementNode
- ClassParser.php in vendor/
symfony/ css-selector/ Parser/ Shortcut/ ClassParser.php - ElementParser.php in vendor/
symfony/ css-selector/ Parser/ Shortcut/ ElementParser.php - EmptyStringParser.php in vendor/
symfony/ css-selector/ Parser/ Shortcut/ EmptyStringParser.php - HashParser.php in vendor/
symfony/ css-selector/ Parser/ Shortcut/ HashParser.php
File
-
vendor/
symfony/ css-selector/ Node/ ElementNode.php, line 24
Namespace
Symfony\Component\CssSelector\NodeView source
class ElementNode extends AbstractNode {
public function __construct(?string $namespace = null, ?string $element = null) {
}
public function getNamespace() : ?string {
return $this->namespace;
}
public function getElement() : ?string {
return $this->element;
}
public function getSpecificity() : Specificity {
return new Specificity(0, 0, $this->element ? 1 : 0);
}
public function __toString() : string {
$element = $this->element ?: '*';
return \sprintf('%s[%s]', $this->getNodeName(), $this->namespace ? $this->namespace . '|' . $element : $element);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
AbstractNode::$nodeName | private | property | ||
AbstractNode::getNodeName | public | function | Overrides NodeInterface::getNodeName | |
ElementNode::getElement | public | function | ||
ElementNode::getNamespace | public | function | ||
ElementNode::getSpecificity | public | function | Overrides NodeInterface::getSpecificity | |
ElementNode::__construct | public | function | ||
ElementNode::__toString | public | function |