ALPHA 3.0.2a

This commit is contained in:
TheGamecraft
2018-09-10 08:51:18 -04:00
parent 7fe13ae0a7
commit 0e0ef86b71
1404 changed files with 10604 additions and 33714 deletions

View File

@@ -13,9 +13,9 @@ namespace Symfony\Component\CssSelector\Parser\Handler;
use Symfony\Component\CssSelector\Parser\Reader;
use Symfony\Component\CssSelector\Parser\Token;
use Symfony\Component\CssSelector\Parser\TokenStream;
use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping;
use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
use Symfony\Component\CssSelector\Parser\TokenStream;
/**
* CSS selector comment handler.
@@ -51,7 +51,7 @@ class HashHandler implements HandlerInterface
$value = $this->escaping->escapeUnicode($match[1]);
$stream->push(new Token(Token::TYPE_HASH, $value, $reader->getPosition()));
$reader->moveForward(strlen($match[0]));
$reader->moveForward(\strlen($match[0]));
return true;
}

View File

@@ -13,9 +13,9 @@ namespace Symfony\Component\CssSelector\Parser\Handler;
use Symfony\Component\CssSelector\Parser\Reader;
use Symfony\Component\CssSelector\Parser\Token;
use Symfony\Component\CssSelector\Parser\TokenStream;
use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping;
use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
use Symfony\Component\CssSelector\Parser\TokenStream;
/**
* CSS selector comment handler.
@@ -51,7 +51,7 @@ class IdentifierHandler implements HandlerInterface
$value = $this->escaping->escapeUnicode($match[0]);
$stream->push(new Token(Token::TYPE_IDENTIFIER, $value, $reader->getPosition()));
$reader->moveForward(strlen($match[0]));
$reader->moveForward(\strlen($match[0]));
return true;
}

View File

@@ -13,8 +13,8 @@ namespace Symfony\Component\CssSelector\Parser\Handler;
use Symfony\Component\CssSelector\Parser\Reader;
use Symfony\Component\CssSelector\Parser\Token;
use Symfony\Component\CssSelector\Parser\TokenStream;
use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
use Symfony\Component\CssSelector\Parser\TokenStream;
/**
* CSS selector comment handler.
@@ -47,7 +47,7 @@ class NumberHandler implements HandlerInterface
}
$stream->push(new Token(Token::TYPE_NUMBER, $match[0], $reader->getPosition()));
$reader->moveForward(strlen($match[0]));
$reader->moveForward(\strlen($match[0]));
return true;
}

View File

@@ -15,9 +15,9 @@ use Symfony\Component\CssSelector\Exception\InternalErrorException;
use Symfony\Component\CssSelector\Exception\SyntaxErrorException;
use Symfony\Component\CssSelector\Parser\Reader;
use Symfony\Component\CssSelector\Parser\Token;
use Symfony\Component\CssSelector\Parser\TokenStream;
use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping;
use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
use Symfony\Component\CssSelector\Parser\TokenStream;
/**
* CSS selector comment handler.
@@ -47,7 +47,7 @@ class StringHandler implements HandlerInterface
{
$quote = $reader->getSubstring(1);
if (!in_array($quote, array("'", '"'))) {
if (!\in_array($quote, array("'", '"'))) {
return false;
}
@@ -59,18 +59,18 @@ class StringHandler implements HandlerInterface
}
// check unclosed strings
if (strlen($match[0]) === $reader->getRemainingLength()) {
if (\strlen($match[0]) === $reader->getRemainingLength()) {
throw SyntaxErrorException::unclosedString($reader->getPosition() - 1);
}
// check quotes pairs validity
if ($quote !== $reader->getSubstring(1, strlen($match[0]))) {
if ($quote !== $reader->getSubstring(1, \strlen($match[0]))) {
throw SyntaxErrorException::unclosedString($reader->getPosition() - 1);
}
$string = $this->escaping->escapeUnicodeAndNewLine($match[0]);
$stream->push(new Token(Token::TYPE_STRING, $string, $reader->getPosition()));
$reader->moveForward(strlen($match[0]) + 1);
$reader->moveForward(\strlen($match[0]) + 1);
return true;
}

View File

@@ -39,7 +39,7 @@ class WhitespaceHandler implements HandlerInterface
}
$stream->push(new Token(Token::TYPE_WHITESPACE, $match[0], $reader->getPosition()));
$reader->moveForward(strlen($match[0]));
$reader->moveForward(\strlen($match[0]));
return true;
}

View File

@@ -150,7 +150,7 @@ class Parser implements ParserInterface
{
$stream->skipWhitespace();
$selectorStart = count($stream->getUsed());
$selectorStart = \count($stream->getUsed());
$result = $this->parseElementNode($stream);
$pseudoElement = null;
@@ -187,7 +187,7 @@ class Parser implements ParserInterface
}
$identifier = $stream->getNextIdentifier();
if (in_array(strtolower($identifier), array('first-line', 'first-letter', 'before', 'after'))) {
if (\in_array(strtolower($identifier), array('first-line', 'first-letter', 'before', 'after'))) {
// Special case: CSS 2.1 pseudo-elements can have a single ':'.
// Any new pseudo-element must have two.
$pseudoElement = $identifier;
@@ -253,7 +253,7 @@ class Parser implements ParserInterface
}
}
if (count($stream->getUsed()) === $selectorStart) {
if (\count($stream->getUsed()) === $selectorStart) {
throw SyntaxErrorException::unexpectedToken('selector', $stream->getPeek());
}

View File

@@ -30,7 +30,7 @@ class Reader
public function __construct(string $source)
{
$this->source = $source;
$this->length = strlen($source);
$this->length = \strlen($source);
}
public function isEOF(): bool

View File

@@ -72,7 +72,7 @@ class Token
return true;
}
return in_array($this->value, $values);
return \in_array($this->value, $values);
}
public function isWhitespace(): bool

View File

@@ -50,13 +50,13 @@ class TokenizerEscaping
$c = hexdec($match[1]);
if (0x80 > $c %= 0x200000) {
return chr($c);
return \chr($c);
}
if (0x800 > $c) {
return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F);
return \chr(0xC0 | $c >> 6).\chr(0x80 | $c & 0x3F);
}
if (0x10000 > $c) {
return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F);
return \chr(0xE0 | $c >> 12).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F);
}
}, $value);
}