mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-02 21:19:58 +09:00
Update to laravel 7
This commit is contained in:
@@ -26,8 +26,5 @@ use Symfony\Component\CssSelector\Parser\TokenStream;
|
||||
*/
|
||||
interface HandlerInterface
|
||||
{
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function handle(Reader $reader, TokenStream $stream): bool;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class StringHandler implements HandlerInterface
|
||||
$match = $reader->findPattern($this->patterns->getQuotedStringPattern($quote));
|
||||
|
||||
if (!$match) {
|
||||
throw new InternalErrorException(sprintf('Should have found at least an empty match at %s.', $reader->getPosition()));
|
||||
throw new InternalErrorException(sprintf('Should have found at least an empty match at %d.', $reader->getPosition()));
|
||||
}
|
||||
|
||||
// check unclosed strings
|
||||
|
||||
12
vendor/symfony/css-selector/Parser/Parser.php
vendored
12
vendor/symfony/css-selector/Parser/Parser.php
vendored
@@ -31,7 +31,7 @@ class Parser implements ParserInterface
|
||||
|
||||
public function __construct(Tokenizer $tokenizer = null)
|
||||
{
|
||||
$this->tokenizer = $tokenizer ?: new Tokenizer();
|
||||
$this->tokenizer = $tokenizer ?? new Tokenizer();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,12 +79,12 @@ class Parser implements ParserInterface
|
||||
return [2, 0];
|
||||
case 'n' === $joined:
|
||||
return [1, 0];
|
||||
case false === strpos($joined, 'n'):
|
||||
case !str_contains($joined, 'n'):
|
||||
return [0, $int($joined)];
|
||||
}
|
||||
|
||||
$split = explode('n', $joined);
|
||||
$first = isset($split[0]) ? $split[0] : null;
|
||||
$first = $split[0] ?? null;
|
||||
|
||||
return [
|
||||
$first ? ('-' === $first || '+' === $first ? $int($first.'1') : $int($first)) : 1,
|
||||
@@ -113,7 +113,7 @@ class Parser implements ParserInterface
|
||||
|
||||
private function parserSelectorNode(TokenStream $stream): Node\SelectorNode
|
||||
{
|
||||
list($result, $pseudoElement) = $this->parseSimpleSelector($stream);
|
||||
[$result, $pseudoElement] = $this->parseSimpleSelector($stream);
|
||||
|
||||
while (true) {
|
||||
$stream->skipWhitespace();
|
||||
@@ -134,7 +134,7 @@ class Parser implements ParserInterface
|
||||
$combinator = ' ';
|
||||
}
|
||||
|
||||
list($nextSelector, $pseudoElement) = $this->parseSimpleSelector($stream);
|
||||
[$nextSelector, $pseudoElement] = $this->parseSimpleSelector($stream);
|
||||
$result = new Node\CombinedSelectorNode($result, $combinator, $nextSelector);
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ class Parser implements ParserInterface
|
||||
throw SyntaxErrorException::nestedNot();
|
||||
}
|
||||
|
||||
list($argument, $argumentPseudoElement) = $this->parseSimpleSelector($stream, true);
|
||||
[$argument, $argumentPseudoElement] = $this->parseSimpleSelector($stream, true);
|
||||
$next = $stream->getNext();
|
||||
|
||||
if (null !== $argumentPseudoElement) {
|
||||
|
||||
14
vendor/symfony/css-selector/Parser/Token.php
vendored
14
vendor/symfony/css-selector/Parser/Token.php
vendored
@@ -23,13 +23,13 @@ namespace Symfony\Component\CssSelector\Parser;
|
||||
*/
|
||||
class Token
|
||||
{
|
||||
const TYPE_FILE_END = 'eof';
|
||||
const TYPE_DELIMITER = 'delimiter';
|
||||
const TYPE_WHITESPACE = 'whitespace';
|
||||
const TYPE_IDENTIFIER = 'identifier';
|
||||
const TYPE_HASH = 'hash';
|
||||
const TYPE_NUMBER = 'number';
|
||||
const TYPE_STRING = 'string';
|
||||
public const TYPE_FILE_END = 'eof';
|
||||
public const TYPE_DELIMITER = 'delimiter';
|
||||
public const TYPE_WHITESPACE = 'whitespace';
|
||||
public const TYPE_IDENTIFIER = 'identifier';
|
||||
public const TYPE_HASH = 'hash';
|
||||
public const TYPE_NUMBER = 'number';
|
||||
public const TYPE_STRING = 'string';
|
||||
|
||||
private $type;
|
||||
private $value;
|
||||
|
||||
@@ -56,7 +56,7 @@ class TokenStream
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function push(Token $token)
|
||||
public function push(Token $token): self
|
||||
{
|
||||
$this->tokens[] = $token;
|
||||
|
||||
@@ -68,7 +68,7 @@ class TokenStream
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function freeze()
|
||||
public function freeze(): self
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
@@ -76,11 +76,9 @@ class TokenStream
|
||||
/**
|
||||
* Returns next token.
|
||||
*
|
||||
* @return Token
|
||||
*
|
||||
* @throws InternalErrorException If there is no more token
|
||||
*/
|
||||
public function getNext()
|
||||
public function getNext(): Token
|
||||
{
|
||||
if ($this->peeking) {
|
||||
$this->peeking = false;
|
||||
@@ -98,10 +96,8 @@ class TokenStream
|
||||
|
||||
/**
|
||||
* Returns peeked token.
|
||||
*
|
||||
* @return Token
|
||||
*/
|
||||
public function getPeek()
|
||||
public function getPeek(): Token
|
||||
{
|
||||
if (!$this->peeking) {
|
||||
$this->peeked = $this->getNext();
|
||||
@@ -116,19 +112,17 @@ class TokenStream
|
||||
*
|
||||
* @return Token[]
|
||||
*/
|
||||
public function getUsed()
|
||||
public function getUsed(): array
|
||||
{
|
||||
return $this->used;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns nex identifier token.
|
||||
*
|
||||
* @return string The identifier token value
|
||||
* Returns next identifier token.
|
||||
*
|
||||
* @throws SyntaxErrorException If next token is not an identifier
|
||||
*/
|
||||
public function getNextIdentifier()
|
||||
public function getNextIdentifier(): string
|
||||
{
|
||||
$next = $this->getNext();
|
||||
|
||||
@@ -140,13 +134,11 @@ class TokenStream
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns nex identifier or star delimiter token.
|
||||
*
|
||||
* @return string|null The identifier token value or null if star found
|
||||
* Returns next identifier or null if star delimiter token is found.
|
||||
*
|
||||
* @throws SyntaxErrorException If next token is not an identifier or a star delimiter
|
||||
*/
|
||||
public function getNextIdentifierOrStar()
|
||||
public function getNextIdentifierOrStar(): ?string
|
||||
{
|
||||
$next = $this->getNext();
|
||||
|
||||
@@ -155,7 +147,7 @@ class TokenStream
|
||||
}
|
||||
|
||||
if ($next->isDelimiter(['*'])) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
throw SyntaxErrorException::unexpectedToken('identifier or "*"', $next);
|
||||
|
||||
@@ -50,10 +50,8 @@ class Tokenizer
|
||||
|
||||
/**
|
||||
* Tokenize selector source code.
|
||||
*
|
||||
* @return TokenStream
|
||||
*/
|
||||
public function tokenize(Reader $reader)
|
||||
public function tokenize(Reader $reader): TokenStream
|
||||
{
|
||||
$stream = new TokenStream();
|
||||
|
||||
|
||||
@@ -58,6 +58,8 @@ class TokenizerEscaping
|
||||
if (0x10000 > $c) {
|
||||
return \chr(0xE0 | $c >> 12).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F);
|
||||
}
|
||||
|
||||
return '';
|
||||
}, $value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user