Update to laravel 7

This commit is contained in:
KodeStar
2022-03-10 11:54:29 +00:00
parent 61a5a1a8b0
commit f9a19fce91
7170 changed files with 274189 additions and 283773 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;

View File

@@ -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 ?: '*';

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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 : '');

View File

@@ -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;