class FunctionNode in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/css-selector/Node/FunctionNode.php \Symfony\Component\CssSelector\Node\FunctionNode
Represents a "<selector>:<name>(<arguments>)" 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\FunctionNode
Expanded class hierarchy of FunctionNode
See also
https://github.com/SimonSapin/cssselect.
5 files declare their use of FunctionNode
- FunctionExtension.php in vendor/
symfony/ css-selector/ XPath/ Extension/ FunctionExtension.php - FunctionNodeTest.php in vendor/
symfony/ css-selector/ Tests/ Node/ FunctionNodeTest.php - HtmlExtension.php in vendor/
symfony/ css-selector/ XPath/ Extension/ HtmlExtension.php - ParserTest.php in vendor/
symfony/ css-selector/ Tests/ Parser/ ParserTest.php - Translator.php in vendor/
symfony/ css-selector/ XPath/ Translator.php
File
- vendor/
symfony/ css-selector/ Node/ FunctionNode.php, line 24
Namespace
Symfony\Component\CssSelector\NodeView source
class FunctionNode extends AbstractNode {
/**
* @var NodeInterface
*/
private $selector;
/**
* @var string
*/
private $name;
/**
* @var Token[]
*/
private $arguments;
/**
* @param NodeInterface $selector
* @param string $name
* @param Token[] $arguments
*/
public function __construct(NodeInterface $selector, $name, array $arguments = array()) {
$this->selector = $selector;
$this->name = strtolower($name);
$this->arguments = $arguments;
}
/**
* @return NodeInterface
*/
public function getSelector() {
return $this->selector;
}
/**
* @return string
*/
public function getName() {
return $this->name;
}
/**
* @return Token[]
*/
public function getArguments() {
return $this->arguments;
}
/**
* {@inheritdoc}
*/
public function getSpecificity() {
return $this->selector
->getSpecificity()
->plus(new Specificity(0, 1, 0));
}
/**
* {@inheritdoc}
*/
public function __toString() {
$arguments = implode(', ', array_map(function (Token $token) {
return "'" . $token
->getValue() . "'";
}, $this->arguments));
return sprintf('%s[%s:%s(%s)]', $this
->getNodeName(), $this->selector, $this->name, $arguments ? '[' . $arguments . ']' : '');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AbstractNode:: |
private | property | ||
AbstractNode:: |
public | function |
Overrides NodeInterface:: |
|
FunctionNode:: |
private | property | ||
FunctionNode:: |
private | property | ||
FunctionNode:: |
private | property | ||
FunctionNode:: |
public | function | ||
FunctionNode:: |
public | function | ||
FunctionNode:: |
public | function | ||
FunctionNode:: |
public | function |
Returns node's specificity. Overrides NodeInterface:: |
|
FunctionNode:: |
public | function | ||
FunctionNode:: |
public | function |
Returns node's string representation. Overrides NodeInterface:: |