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