mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-03 05:29:53 +09:00
Update to laravel 7
This commit is contained in:
@@ -28,13 +28,10 @@ abstract class AbstractNode implements NodeInterface
|
||||
*/
|
||||
private $nodeName;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getNodeName(): string
|
||||
{
|
||||
if (null === $this->nodeName) {
|
||||
$this->nodeName = preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', \get_called_class());
|
||||
$this->nodeName = preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', static::class);
|
||||
}
|
||||
|
||||
return $this->nodeName;
|
||||
|
||||
@@ -71,9 +71,6 @@ class AttributeNode extends AbstractNode
|
||||
return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
$attribute = $this->namespace ? $this->namespace.'|'.$this->attribute : $this->attribute;
|
||||
|
||||
@@ -50,9 +50,6 @@ class ClassNode extends AbstractNode
|
||||
return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return sprintf('%s[%s.%s]', $this->getNodeName(), $this->selector, $this->name);
|
||||
|
||||
@@ -57,9 +57,6 @@ class CombinedSelectorNode extends AbstractNode
|
||||
return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity());
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
$combinator = ' ' === $this->combinator ? '<followed>' : $this->combinator;
|
||||
|
||||
17
vendor/symfony/css-selector/Node/ElementNode.php
vendored
17
vendor/symfony/css-selector/Node/ElementNode.php
vendored
@@ -26,28 +26,18 @@ class ElementNode extends AbstractNode
|
||||
private $namespace;
|
||||
private $element;
|
||||
|
||||
/**
|
||||
* @param string|null $namespace
|
||||
* @param string|null $element
|
||||
*/
|
||||
public function __construct(string $namespace = null, string $element = null)
|
||||
{
|
||||
$this->namespace = $namespace;
|
||||
$this->element = $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getNamespace()
|
||||
public function getNamespace(): ?string
|
||||
{
|
||||
return $this->namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getElement()
|
||||
public function getElement(): ?string
|
||||
{
|
||||
return $this->element;
|
||||
}
|
||||
@@ -60,9 +50,6 @@ class ElementNode extends AbstractNode
|
||||
return new Specificity(0, 0, $this->element ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
$element = $this->element ?: '*';
|
||||
|
||||
@@ -30,9 +30,7 @@ class FunctionNode extends AbstractNode
|
||||
private $arguments;
|
||||
|
||||
/**
|
||||
* @param NodeInterface $selector
|
||||
* @param string $name
|
||||
* @param Token[] $arguments
|
||||
* @param Token[] $arguments
|
||||
*/
|
||||
public function __construct(NodeInterface $selector, string $name, array $arguments = [])
|
||||
{
|
||||
@@ -54,7 +52,7 @@ class FunctionNode extends AbstractNode
|
||||
/**
|
||||
* @return Token[]
|
||||
*/
|
||||
public function getArguments()
|
||||
public function getArguments(): array
|
||||
{
|
||||
return $this->arguments;
|
||||
}
|
||||
@@ -67,9 +65,6 @@ class FunctionNode extends AbstractNode
|
||||
return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
$arguments = implode(', ', array_map(function (Token $token) {
|
||||
|
||||
@@ -50,9 +50,6 @@ class HashNode extends AbstractNode
|
||||
return $this->selector->getSpecificity()->plus(new Specificity(1, 0, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return sprintf('%s[%s#%s]', $this->getNodeName(), $this->selector, $this->id);
|
||||
|
||||
@@ -32,18 +32,12 @@ class NegationNode extends AbstractNode
|
||||
$this->subSelector = $subSelector;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return NodeInterface
|
||||
*/
|
||||
public function getSelector()
|
||||
public function getSelector(): NodeInterface
|
||||
{
|
||||
return $this->selector;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return NodeInterface
|
||||
*/
|
||||
public function getSubSelector()
|
||||
public function getSubSelector(): NodeInterface
|
||||
{
|
||||
return $this->subSelector;
|
||||
}
|
||||
@@ -56,9 +50,6 @@ class NegationNode extends AbstractNode
|
||||
return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity());
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return sprintf('%s[%s:not(%s)]', $this->getNodeName(), $this->selector, $this->subSelector);
|
||||
|
||||
@@ -50,9 +50,6 @@ class PseudoNode extends AbstractNode
|
||||
return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return sprintf('%s[%s:%s]', $this->getNodeName(), $this->selector, $this->identifier);
|
||||
|
||||
@@ -50,9 +50,6 @@ class SelectorNode extends AbstractNode
|
||||
return $this->tree->getSpecificity()->plus(new Specificity(0, 0, $this->pseudoElement ? 1 : 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return sprintf('%s[%s%s]', $this->getNodeName(), $this->tree, $this->pseudoElement ? '::'.$this->pseudoElement : '');
|
||||
|
||||
10
vendor/symfony/css-selector/Node/Specificity.php
vendored
10
vendor/symfony/css-selector/Node/Specificity.php
vendored
@@ -25,9 +25,9 @@ namespace Symfony\Component\CssSelector\Node;
|
||||
*/
|
||||
class Specificity
|
||||
{
|
||||
const A_FACTOR = 100;
|
||||
const B_FACTOR = 10;
|
||||
const C_FACTOR = 1;
|
||||
public const A_FACTOR = 100;
|
||||
public const B_FACTOR = 10;
|
||||
public const C_FACTOR = 1;
|
||||
|
||||
private $a;
|
||||
private $b;
|
||||
@@ -53,10 +53,8 @@ class Specificity
|
||||
/**
|
||||
* Returns -1 if the object specificity is lower than the argument,
|
||||
* 0 if they are equal, and 1 if the argument is lower.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function compareTo(self $specificity)
|
||||
public function compareTo(self $specificity): int
|
||||
{
|
||||
if ($this->a !== $specificity->a) {
|
||||
return $this->a > $specificity->a ? 1 : -1;
|
||||
|
||||
Reference in New Issue
Block a user