laravel-6 support
This commit is contained in:
@@ -23,38 +23,21 @@ namespace Symfony\Component\CssSelector\Node;
|
||||
*/
|
||||
class SelectorNode extends AbstractNode
|
||||
{
|
||||
/**
|
||||
* @var NodeInterface
|
||||
*/
|
||||
private $tree;
|
||||
|
||||
/**
|
||||
* @var null|string
|
||||
*/
|
||||
private $pseudoElement;
|
||||
|
||||
/**
|
||||
* @param NodeInterface $tree
|
||||
* @param null|string $pseudoElement
|
||||
*/
|
||||
public function __construct(NodeInterface $tree, $pseudoElement = null)
|
||||
public function __construct(NodeInterface $tree, string $pseudoElement = null)
|
||||
{
|
||||
$this->tree = $tree;
|
||||
$this->pseudoElement = $pseudoElement ? strtolower($pseudoElement) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return NodeInterface
|
||||
*/
|
||||
public function getTree()
|
||||
public function getTree(): NodeInterface
|
||||
{
|
||||
return $this->tree;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|string
|
||||
*/
|
||||
public function getPseudoElement()
|
||||
public function getPseudoElement(): ?string
|
||||
{
|
||||
return $this->pseudoElement;
|
||||
}
|
||||
@@ -62,15 +45,12 @@ class SelectorNode extends AbstractNode
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSpecificity()
|
||||
public function getSpecificity(): Specificity
|
||||
{
|
||||
return $this->tree->getSpecificity()->plus(new Specificity(0, 0, $this->pseudoElement ? 1 : 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __toString()
|
||||
public function __toString(): string
|
||||
{
|
||||
return sprintf('%s[%s%s]', $this->getNodeName(), $this->tree, $this->pseudoElement ? '::'.$this->pseudoElement : '');
|
||||
}
|
||||
|
Reference in New Issue
Block a user