mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-09 16:33:56 +09:00
Update dependencies
This commit is contained in:
@@ -26,11 +26,11 @@ use Symfony\Component\CssSelector\XPath\Translator;
|
||||
*/
|
||||
class CssSelectorConverter
|
||||
{
|
||||
private $translator;
|
||||
private $cache;
|
||||
private Translator $translator;
|
||||
private array $cache;
|
||||
|
||||
private static $xmlCache = [];
|
||||
private static $htmlCache = [];
|
||||
private static array $xmlCache = [];
|
||||
private static array $htmlCache = [];
|
||||
|
||||
/**
|
||||
* @param bool $html Whether HTML support should be enabled. Disable it for XML documents
|
||||
@@ -59,11 +59,9 @@ class CssSelectorConverter
|
||||
*
|
||||
* Optionally, a prefix can be added to the resulting XPath
|
||||
* expression with the $prefix parameter.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toXPath(string $cssExpr, string $prefix = 'descendant-or-self::')
|
||||
public function toXPath(string $cssExpr, string $prefix = 'descendant-or-self::'): string
|
||||
{
|
||||
return $this->cache[$prefix][$cssExpr] ?? $this->cache[$prefix][$cssExpr] = $this->translator->cssToXPath($cssExpr, $prefix);
|
||||
return $this->cache[$prefix][$cssExpr] ??= $this->translator->cssToXPath($cssExpr, $prefix);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,42 +23,27 @@ use Symfony\Component\CssSelector\Parser\Token;
|
||||
*/
|
||||
class SyntaxErrorException extends ParseException
|
||||
{
|
||||
/**
|
||||
* @return self
|
||||
*/
|
||||
public static function unexpectedToken(string $expectedValue, Token $foundToken)
|
||||
public static function unexpectedToken(string $expectedValue, Token $foundToken): self
|
||||
{
|
||||
return new self(sprintf('Expected %s, but %s found.', $expectedValue, $foundToken));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return self
|
||||
*/
|
||||
public static function pseudoElementFound(string $pseudoElement, string $unexpectedLocation)
|
||||
public static function pseudoElementFound(string $pseudoElement, string $unexpectedLocation): self
|
||||
{
|
||||
return new self(sprintf('Unexpected pseudo-element "::%s" found %s.', $pseudoElement, $unexpectedLocation));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return self
|
||||
*/
|
||||
public static function unclosedString(int $position)
|
||||
public static function unclosedString(int $position): self
|
||||
{
|
||||
return new self(sprintf('Unclosed/invalid string at %s.', $position));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return self
|
||||
*/
|
||||
public static function nestedNot()
|
||||
public static function nestedNot(): self
|
||||
{
|
||||
return new self('Got nested ::not().');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return self
|
||||
*/
|
||||
public static function stringAsFunctionArgument()
|
||||
public static function stringAsFunctionArgument(): self
|
||||
{
|
||||
return new self('String not allowed as function argument.');
|
||||
}
|
||||
|
||||
@@ -23,17 +23,10 @@ namespace Symfony\Component\CssSelector\Node;
|
||||
*/
|
||||
abstract class AbstractNode implements NodeInterface
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $nodeName;
|
||||
private string $nodeName;
|
||||
|
||||
public function getNodeName(): string
|
||||
{
|
||||
if (null === $this->nodeName) {
|
||||
$this->nodeName = preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', static::class);
|
||||
}
|
||||
|
||||
return $this->nodeName;
|
||||
return $this->nodeName ??= preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', static::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,11 +23,11 @@ namespace Symfony\Component\CssSelector\Node;
|
||||
*/
|
||||
class AttributeNode extends AbstractNode
|
||||
{
|
||||
private $selector;
|
||||
private $namespace;
|
||||
private $attribute;
|
||||
private $operator;
|
||||
private $value;
|
||||
private NodeInterface $selector;
|
||||
private ?string $namespace;
|
||||
private string $attribute;
|
||||
private string $operator;
|
||||
private ?string $value;
|
||||
|
||||
public function __construct(NodeInterface $selector, ?string $namespace, string $attribute, string $operator, ?string $value)
|
||||
{
|
||||
|
||||
@@ -23,8 +23,8 @@ namespace Symfony\Component\CssSelector\Node;
|
||||
*/
|
||||
class ClassNode extends AbstractNode
|
||||
{
|
||||
private $selector;
|
||||
private $name;
|
||||
private NodeInterface $selector;
|
||||
private string $name;
|
||||
|
||||
public function __construct(NodeInterface $selector, string $name)
|
||||
{
|
||||
|
||||
@@ -23,9 +23,9 @@ namespace Symfony\Component\CssSelector\Node;
|
||||
*/
|
||||
class CombinedSelectorNode extends AbstractNode
|
||||
{
|
||||
private $selector;
|
||||
private $combinator;
|
||||
private $subSelector;
|
||||
private NodeInterface $selector;
|
||||
private string $combinator;
|
||||
private NodeInterface $subSelector;
|
||||
|
||||
public function __construct(NodeInterface $selector, string $combinator, NodeInterface $subSelector)
|
||||
{
|
||||
|
||||
@@ -23,8 +23,8 @@ namespace Symfony\Component\CssSelector\Node;
|
||||
*/
|
||||
class ElementNode extends AbstractNode
|
||||
{
|
||||
private $namespace;
|
||||
private $element;
|
||||
private ?string $namespace;
|
||||
private ?string $element;
|
||||
|
||||
public function __construct(string $namespace = null, string $element = null)
|
||||
{
|
||||
|
||||
@@ -25,9 +25,9 @@ use Symfony\Component\CssSelector\Parser\Token;
|
||||
*/
|
||||
class FunctionNode extends AbstractNode
|
||||
{
|
||||
private $selector;
|
||||
private $name;
|
||||
private $arguments;
|
||||
private NodeInterface $selector;
|
||||
private string $name;
|
||||
private array $arguments;
|
||||
|
||||
/**
|
||||
* @param Token[] $arguments
|
||||
|
||||
@@ -23,8 +23,8 @@ namespace Symfony\Component\CssSelector\Node;
|
||||
*/
|
||||
class HashNode extends AbstractNode
|
||||
{
|
||||
private $selector;
|
||||
private $id;
|
||||
private NodeInterface $selector;
|
||||
private string $id;
|
||||
|
||||
public function __construct(NodeInterface $selector, string $id)
|
||||
{
|
||||
|
||||
@@ -23,8 +23,8 @@ namespace Symfony\Component\CssSelector\Node;
|
||||
*/
|
||||
class NegationNode extends AbstractNode
|
||||
{
|
||||
private $selector;
|
||||
private $subSelector;
|
||||
private NodeInterface $selector;
|
||||
private NodeInterface $subSelector;
|
||||
|
||||
public function __construct(NodeInterface $selector, NodeInterface $subSelector)
|
||||
{
|
||||
|
||||
@@ -23,8 +23,8 @@ namespace Symfony\Component\CssSelector\Node;
|
||||
*/
|
||||
class PseudoNode extends AbstractNode
|
||||
{
|
||||
private $selector;
|
||||
private $identifier;
|
||||
private NodeInterface $selector;
|
||||
private string $identifier;
|
||||
|
||||
public function __construct(NodeInterface $selector, string $identifier)
|
||||
{
|
||||
|
||||
@@ -23,8 +23,8 @@ namespace Symfony\Component\CssSelector\Node;
|
||||
*/
|
||||
class SelectorNode extends AbstractNode
|
||||
{
|
||||
private $tree;
|
||||
private $pseudoElement;
|
||||
private NodeInterface $tree;
|
||||
private ?string $pseudoElement;
|
||||
|
||||
public function __construct(NodeInterface $tree, string $pseudoElement = null)
|
||||
{
|
||||
|
||||
@@ -29,9 +29,9 @@ class Specificity
|
||||
public const B_FACTOR = 10;
|
||||
public const C_FACTOR = 1;
|
||||
|
||||
private $a;
|
||||
private $b;
|
||||
private $c;
|
||||
private int $a;
|
||||
private int $b;
|
||||
private int $c;
|
||||
|
||||
public function __construct(int $a, int $b, int $c)
|
||||
{
|
||||
|
||||
@@ -29,8 +29,8 @@ use Symfony\Component\CssSelector\Parser\TokenStream;
|
||||
*/
|
||||
class HashHandler implements HandlerInterface
|
||||
{
|
||||
private $patterns;
|
||||
private $escaping;
|
||||
private TokenizerPatterns $patterns;
|
||||
private TokenizerEscaping $escaping;
|
||||
|
||||
public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $escaping)
|
||||
{
|
||||
|
||||
@@ -29,8 +29,8 @@ use Symfony\Component\CssSelector\Parser\TokenStream;
|
||||
*/
|
||||
class IdentifierHandler implements HandlerInterface
|
||||
{
|
||||
private $patterns;
|
||||
private $escaping;
|
||||
private TokenizerPatterns $patterns;
|
||||
private TokenizerEscaping $escaping;
|
||||
|
||||
public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $escaping)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ use Symfony\Component\CssSelector\Parser\TokenStream;
|
||||
*/
|
||||
class NumberHandler implements HandlerInterface
|
||||
{
|
||||
private $patterns;
|
||||
private TokenizerPatterns $patterns;
|
||||
|
||||
public function __construct(TokenizerPatterns $patterns)
|
||||
{
|
||||
|
||||
@@ -31,8 +31,8 @@ use Symfony\Component\CssSelector\Parser\TokenStream;
|
||||
*/
|
||||
class StringHandler implements HandlerInterface
|
||||
{
|
||||
private $patterns;
|
||||
private $escaping;
|
||||
private TokenizerPatterns $patterns;
|
||||
private TokenizerEscaping $escaping;
|
||||
|
||||
public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $escaping)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ use Symfony\Component\CssSelector\Parser\Tokenizer\Tokenizer;
|
||||
*/
|
||||
class Parser implements ParserInterface
|
||||
{
|
||||
private $tokenizer;
|
||||
private Tokenizer $tokenizer;
|
||||
|
||||
public function __construct(Tokenizer $tokenizer = null)
|
||||
{
|
||||
|
||||
11
vendor/symfony/css-selector/Parser/Reader.php
vendored
11
vendor/symfony/css-selector/Parser/Reader.php
vendored
@@ -23,9 +23,9 @@ namespace Symfony\Component\CssSelector\Parser;
|
||||
*/
|
||||
class Reader
|
||||
{
|
||||
private $source;
|
||||
private $length;
|
||||
private $position = 0;
|
||||
private string $source;
|
||||
private int $length;
|
||||
private int $position = 0;
|
||||
|
||||
public function __construct(string $source)
|
||||
{
|
||||
@@ -60,10 +60,7 @@ class Reader
|
||||
return false === $position ? false : $position - $this->position;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|false
|
||||
*/
|
||||
public function findPattern(string $pattern)
|
||||
public function findPattern(string $pattern): array|false
|
||||
{
|
||||
$source = substr($this->source, $this->position);
|
||||
|
||||
|
||||
6
vendor/symfony/css-selector/Parser/Token.php
vendored
6
vendor/symfony/css-selector/Parser/Token.php
vendored
@@ -31,9 +31,9 @@ class Token
|
||||
public const TYPE_NUMBER = 'number';
|
||||
public const TYPE_STRING = 'string';
|
||||
|
||||
private $type;
|
||||
private $value;
|
||||
private $position;
|
||||
private ?string $type;
|
||||
private ?string $value;
|
||||
private ?int $position;
|
||||
|
||||
public function __construct(?string $type, ?string $value, ?int $position)
|
||||
{
|
||||
|
||||
@@ -29,34 +29,23 @@ class TokenStream
|
||||
/**
|
||||
* @var Token[]
|
||||
*/
|
||||
private $tokens = [];
|
||||
private array $tokens = [];
|
||||
|
||||
/**
|
||||
* @var Token[]
|
||||
*/
|
||||
private $used = [];
|
||||
private array $used = [];
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $cursor = 0;
|
||||
|
||||
/**
|
||||
* @var Token|null
|
||||
*/
|
||||
private $peeked;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $peeking = false;
|
||||
private int $cursor = 0;
|
||||
private ?Token $peeked;
|
||||
private bool $peeking = false;
|
||||
|
||||
/**
|
||||
* Pushes a token.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function push(Token $token): self
|
||||
public function push(Token $token): static
|
||||
{
|
||||
$this->tokens[] = $token;
|
||||
|
||||
@@ -68,7 +57,7 @@ class TokenStream
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function freeze(): self
|
||||
public function freeze(): static
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class Tokenizer
|
||||
/**
|
||||
* @var Handler\HandlerInterface[]
|
||||
*/
|
||||
private $handlers;
|
||||
private array $handlers;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Symfony\Component\CssSelector\Parser\Tokenizer;
|
||||
*/
|
||||
class TokenizerEscaping
|
||||
{
|
||||
private $patterns;
|
||||
private TokenizerPatterns $patterns;
|
||||
|
||||
public function __construct(TokenizerPatterns $patterns)
|
||||
{
|
||||
|
||||
@@ -23,18 +23,18 @@ namespace Symfony\Component\CssSelector\Parser\Tokenizer;
|
||||
*/
|
||||
class TokenizerPatterns
|
||||
{
|
||||
private $unicodeEscapePattern;
|
||||
private $simpleEscapePattern;
|
||||
private $newLineEscapePattern;
|
||||
private $escapePattern;
|
||||
private $stringEscapePattern;
|
||||
private $nonAsciiPattern;
|
||||
private $nmCharPattern;
|
||||
private $nmStartPattern;
|
||||
private $identifierPattern;
|
||||
private $hashPattern;
|
||||
private $numberPattern;
|
||||
private $quotedStringPattern;
|
||||
private string $unicodeEscapePattern;
|
||||
private string $simpleEscapePattern;
|
||||
private string $newLineEscapePattern;
|
||||
private string $escapePattern;
|
||||
private string $stringEscapePattern;
|
||||
private string $nonAsciiPattern;
|
||||
private string $nmCharPattern;
|
||||
private string $nmStartPattern;
|
||||
private string $identifierPattern;
|
||||
private string $hashPattern;
|
||||
private string $numberPattern;
|
||||
private string $quotedStringPattern;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -32,14 +32,14 @@ class AttributeMatchingExtension extends AbstractExtension
|
||||
public function getAttributeMatchingTranslators(): array
|
||||
{
|
||||
return [
|
||||
'exists' => [$this, 'translateExists'],
|
||||
'=' => [$this, 'translateEquals'],
|
||||
'~=' => [$this, 'translateIncludes'],
|
||||
'|=' => [$this, 'translateDashMatch'],
|
||||
'^=' => [$this, 'translatePrefixMatch'],
|
||||
'$=' => [$this, 'translateSuffixMatch'],
|
||||
'*=' => [$this, 'translateSubstringMatch'],
|
||||
'!=' => [$this, 'translateDifferent'],
|
||||
'exists' => $this->translateExists(...),
|
||||
'=' => $this->translateEquals(...),
|
||||
'~=' => $this->translateIncludes(...),
|
||||
'|=' => $this->translateDashMatch(...),
|
||||
'^=' => $this->translatePrefixMatch(...),
|
||||
'$=' => $this->translateSuffixMatch(...),
|
||||
'*=' => $this->translateSubstringMatch(...),
|
||||
'!=' => $this->translateDifferent(...),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ class CombinationExtension extends AbstractExtension
|
||||
public function getCombinationTranslators(): array
|
||||
{
|
||||
return [
|
||||
' ' => [$this, 'translateDescendant'],
|
||||
'>' => [$this, 'translateChild'],
|
||||
'+' => [$this, 'translateDirectAdjacent'],
|
||||
'~' => [$this, 'translateIndirectAdjacent'],
|
||||
' ' => $this->translateDescendant(...),
|
||||
'>' => $this->translateChild(...),
|
||||
'+' => $this->translateDirectAdjacent(...),
|
||||
'~' => $this->translateIndirectAdjacent(...),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -36,12 +36,12 @@ class FunctionExtension extends AbstractExtension
|
||||
public function getFunctionTranslators(): array
|
||||
{
|
||||
return [
|
||||
'nth-child' => [$this, 'translateNthChild'],
|
||||
'nth-last-child' => [$this, 'translateNthLastChild'],
|
||||
'nth-of-type' => [$this, 'translateNthOfType'],
|
||||
'nth-last-of-type' => [$this, 'translateNthLastOfType'],
|
||||
'contains' => [$this, 'translateContains'],
|
||||
'lang' => [$this, 'translateLang'],
|
||||
'nth-child' => $this->translateNthChild(...),
|
||||
'nth-last-child' => $this->translateNthLastChild(...),
|
||||
'nth-of-type' => $this->translateNthOfType(...),
|
||||
'nth-last-of-type' => $this->translateNthLastOfType(...),
|
||||
'contains' => $this->translateContains(...),
|
||||
'lang' => $this->translateLang(...),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -42,14 +42,14 @@ class HtmlExtension extends AbstractExtension
|
||||
public function getPseudoClassTranslators(): array
|
||||
{
|
||||
return [
|
||||
'checked' => [$this, 'translateChecked'],
|
||||
'link' => [$this, 'translateLink'],
|
||||
'disabled' => [$this, 'translateDisabled'],
|
||||
'enabled' => [$this, 'translateEnabled'],
|
||||
'selected' => [$this, 'translateSelected'],
|
||||
'invalid' => [$this, 'translateInvalid'],
|
||||
'hover' => [$this, 'translateHover'],
|
||||
'visited' => [$this, 'translateVisited'],
|
||||
'checked' => $this->translateChecked(...),
|
||||
'link' => $this->translateLink(...),
|
||||
'disabled' => $this->translateDisabled(...),
|
||||
'enabled' => $this->translateEnabled(...),
|
||||
'selected' => $this->translateSelected(...),
|
||||
'invalid' => $this->translateInvalid(...),
|
||||
'hover' => $this->translateHover(...),
|
||||
'visited' => $this->translateVisited(...),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class HtmlExtension extends AbstractExtension
|
||||
public function getFunctionTranslators(): array
|
||||
{
|
||||
return [
|
||||
'lang' => [$this, 'translateLang'],
|
||||
'lang' => $this->translateLang(...),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class NodeExtension extends AbstractExtension
|
||||
public const ATTRIBUTE_NAME_IN_LOWER_CASE = 2;
|
||||
public const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4;
|
||||
|
||||
private $flags;
|
||||
private int $flags;
|
||||
|
||||
public function __construct(int $flags = 0)
|
||||
{
|
||||
@@ -41,7 +41,7 @@ class NodeExtension extends AbstractExtension
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setFlag(int $flag, bool $on): self
|
||||
public function setFlag(int $flag, bool $on): static
|
||||
{
|
||||
if ($on && !$this->hasFlag($flag)) {
|
||||
$this->flags += $flag;
|
||||
@@ -65,15 +65,15 @@ class NodeExtension extends AbstractExtension
|
||||
public function getNodeTranslators(): array
|
||||
{
|
||||
return [
|
||||
'Selector' => [$this, 'translateSelector'],
|
||||
'CombinedSelector' => [$this, 'translateCombinedSelector'],
|
||||
'Negation' => [$this, 'translateNegation'],
|
||||
'Function' => [$this, 'translateFunction'],
|
||||
'Pseudo' => [$this, 'translatePseudo'],
|
||||
'Attribute' => [$this, 'translateAttribute'],
|
||||
'Class' => [$this, 'translateClass'],
|
||||
'Hash' => [$this, 'translateHash'],
|
||||
'Element' => [$this, 'translateElement'],
|
||||
'Selector' => $this->translateSelector(...),
|
||||
'CombinedSelector' => $this->translateCombinedSelector(...),
|
||||
'Negation' => $this->translateNegation(...),
|
||||
'Function' => $this->translateFunction(...),
|
||||
'Pseudo' => $this->translatePseudo(...),
|
||||
'Attribute' => $this->translateAttribute(...),
|
||||
'Class' => $this->translateClass(...),
|
||||
'Hash' => $this->translateHash(...),
|
||||
'Element' => $this->translateElement(...),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -32,14 +32,14 @@ class PseudoClassExtension extends AbstractExtension
|
||||
public function getPseudoClassTranslators(): array
|
||||
{
|
||||
return [
|
||||
'root' => [$this, 'translateRoot'],
|
||||
'first-child' => [$this, 'translateFirstChild'],
|
||||
'last-child' => [$this, 'translateLastChild'],
|
||||
'first-of-type' => [$this, 'translateFirstOfType'],
|
||||
'last-of-type' => [$this, 'translateLastOfType'],
|
||||
'only-child' => [$this, 'translateOnlyChild'],
|
||||
'only-of-type' => [$this, 'translateOnlyOfType'],
|
||||
'empty' => [$this, 'translateEmpty'],
|
||||
'root' => $this->translateRoot(...),
|
||||
'first-child' => $this->translateFirstChild(...),
|
||||
'last-child' => $this->translateLastChild(...),
|
||||
'first-of-type' => $this->translateFirstOfType(...),
|
||||
'last-of-type' => $this->translateLastOfType(...),
|
||||
'only-child' => $this->translateOnlyChild(...),
|
||||
'only-of-type' => $this->translateOnlyOfType(...),
|
||||
'empty' => $this->translateEmpty(...),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
20
vendor/symfony/css-selector/XPath/Translator.php
vendored
20
vendor/symfony/css-selector/XPath/Translator.php
vendored
@@ -30,23 +30,23 @@ use Symfony\Component\CssSelector\Parser\ParserInterface;
|
||||
*/
|
||||
class Translator implements TranslatorInterface
|
||||
{
|
||||
private $mainParser;
|
||||
private ParserInterface $mainParser;
|
||||
|
||||
/**
|
||||
* @var ParserInterface[]
|
||||
*/
|
||||
private $shortcutParsers = [];
|
||||
private array $shortcutParsers = [];
|
||||
|
||||
/**
|
||||
* @var Extension\ExtensionInterface[]
|
||||
*/
|
||||
private $extensions = [];
|
||||
private array $extensions = [];
|
||||
|
||||
private $nodeTranslators = [];
|
||||
private $combinationTranslators = [];
|
||||
private $functionTranslators = [];
|
||||
private $pseudoClassTranslators = [];
|
||||
private $attributeMatchingTranslators = [];
|
||||
private array $nodeTranslators = [];
|
||||
private array $combinationTranslators = [];
|
||||
private array $functionTranslators = [];
|
||||
private array $pseudoClassTranslators = [];
|
||||
private array $attributeMatchingTranslators = [];
|
||||
|
||||
public function __construct(ParserInterface $parser = null)
|
||||
{
|
||||
@@ -117,7 +117,7 @@ class Translator implements TranslatorInterface
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function registerExtension(Extension\ExtensionInterface $extension): self
|
||||
public function registerExtension(Extension\ExtensionInterface $extension): static
|
||||
{
|
||||
$this->extensions[$extension->getName()] = $extension;
|
||||
|
||||
@@ -145,7 +145,7 @@ class Translator implements TranslatorInterface
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function registerParserShortcut(ParserInterface $shortcut): self
|
||||
public function registerParserShortcut(ParserInterface $shortcut): static
|
||||
{
|
||||
$this->shortcutParsers[] = $shortcut;
|
||||
|
||||
|
||||
14
vendor/symfony/css-selector/XPath/XPathExpr.php
vendored
14
vendor/symfony/css-selector/XPath/XPathExpr.php
vendored
@@ -23,9 +23,9 @@ namespace Symfony\Component\CssSelector\XPath;
|
||||
*/
|
||||
class XPathExpr
|
||||
{
|
||||
private $path;
|
||||
private $element;
|
||||
private $condition;
|
||||
private string $path;
|
||||
private string $element;
|
||||
private string $condition;
|
||||
|
||||
public function __construct(string $path = '', string $element = '*', string $condition = '', bool $starPrefix = false)
|
||||
{
|
||||
@@ -46,7 +46,7 @@ class XPathExpr
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function addCondition(string $condition): self
|
||||
public function addCondition(string $condition): static
|
||||
{
|
||||
$this->condition = $this->condition ? sprintf('(%s) and (%s)', $this->condition, $condition) : $condition;
|
||||
|
||||
@@ -61,7 +61,7 @@ class XPathExpr
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function addNameTest(): self
|
||||
public function addNameTest(): static
|
||||
{
|
||||
if ('*' !== $this->element) {
|
||||
$this->addCondition('name() = '.Translator::getXpathLiteral($this->element));
|
||||
@@ -74,7 +74,7 @@ class XPathExpr
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function addStarPrefix(): self
|
||||
public function addStarPrefix(): static
|
||||
{
|
||||
$this->path .= '*/';
|
||||
|
||||
@@ -86,7 +86,7 @@ class XPathExpr
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function join(string $combiner, self $expr): self
|
||||
public function join(string $combiner, self $expr): static
|
||||
{
|
||||
$path = $this->__toString().$combiner;
|
||||
|
||||
|
||||
3
vendor/symfony/css-selector/composer.json
vendored
3
vendor/symfony/css-selector/composer.json
vendored
@@ -20,8 +20,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"symfony/polyfill-php80": "^1.16"
|
||||
"php": ">=8.1"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Symfony\\Component\\CssSelector\\": "" },
|
||||
|
||||
Reference in New Issue
Block a user