AbstractNode.php
2 years ago
AttributeNode.php
2 years ago
ClassNode.php
2 years ago
CombinedSelectorNode.php
2 years ago
ElementNode.php
2 years ago
FunctionNode.php
2 years ago
HashNode.php
2 years ago
NegationNode.php
2 years ago
NodeInterface.php
2 years ago
PseudoNode.php
2 years ago
SelectorNode.php
2 years ago
Specificity.php
2 years ago
index.php
2 years ago
HashNode.php
30 lines
| 1 | <?php |
| 2 | namespace MailPoetVendor\Symfony\Component\CssSelector\Node; |
| 3 | if (!defined('ABSPATH')) exit; |
| 4 | class HashNode extends AbstractNode |
| 5 | { |
| 6 | private $selector; |
| 7 | private $id; |
| 8 | public function __construct(NodeInterface $selector, string $id) |
| 9 | { |
| 10 | $this->selector = $selector; |
| 11 | $this->id = $id; |
| 12 | } |
| 13 | public function getSelector() : NodeInterface |
| 14 | { |
| 15 | return $this->selector; |
| 16 | } |
| 17 | public function getId() : string |
| 18 | { |
| 19 | return $this->id; |
| 20 | } |
| 21 | public function getSpecificity() : Specificity |
| 22 | { |
| 23 | return $this->selector->getSpecificity()->plus(new Specificity(1, 0, 0)); |
| 24 | } |
| 25 | public function __toString() : string |
| 26 | { |
| 27 | return \sprintf('%s[%s#%s]', $this->getNodeName(), $this->selector, $this->id); |
| 28 | } |
| 29 | } |
| 30 |