1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- namespace Symfony\Component\CssSelector\Node;
- class SelectorNode extends AbstractNode
- {
-
- private $tree;
-
- private $pseudoElement;
-
- public function __construct(NodeInterface $tree, $pseudoElement = null)
- {
- $this->tree = $tree;
- $this->pseudoElement = $pseudoElement ? strtolower($pseudoElement) : null;
- }
-
- public function getTree()
- {
- return $this->tree;
- }
-
- public function getPseudoElement()
- {
- return $this->pseudoElement;
- }
-
- public function getSpecificity()
- {
- return $this->tree->getSpecificity()->plus(new Specificity(0, 0, $this->pseudoElement ? 1 : 0));
- }
-
- public function __toString()
- {
- return sprintf('%s[%s%s]', $this->getNodeName(), $this->tree, $this->pseudoElement ? '::'.$this->pseudoElement : '');
- }
- }
|