Skip to content

Commit a897c34

Browse files
Merge branch '4.0' into 4.1
* 4.0: Fix Clidumper tests Enable the fixer enforcing fully-qualified calls for compiler-optimized functions Apply fixers Disable the native_constant_invocation fixer until it can be scoped Update the list of excluded files for the CS fixer
2 parents 03ac716 + 002d3ae commit a897c34

File tree

14 files changed

+28
-28
lines changed

14 files changed

+28
-28
lines changed

Node/AbstractNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ abstract class AbstractNode implements NodeInterface
3434
public function getNodeName(): string
3535
{
3636
if (null === $this->nodeName) {
37-
$this->nodeName = preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', get_called_class());
37+
$this->nodeName = preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', \get_called_class());
3838
}
3939

4040
return $this->nodeName;

Parser/Handler/HashHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function handle(Reader $reader, TokenStream $stream): bool
5151

5252
$value = $this->escaping->escapeUnicode($match[1]);
5353
$stream->push(new Token(Token::TYPE_HASH, $value, $reader->getPosition()));
54-
$reader->moveForward(strlen($match[0]));
54+
$reader->moveForward(\strlen($match[0]));
5555

5656
return true;
5757
}

Parser/Handler/IdentifierHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function handle(Reader $reader, TokenStream $stream): bool
5151

5252
$value = $this->escaping->escapeUnicode($match[0]);
5353
$stream->push(new Token(Token::TYPE_IDENTIFIER, $value, $reader->getPosition()));
54-
$reader->moveForward(strlen($match[0]));
54+
$reader->moveForward(\strlen($match[0]));
5555

5656
return true;
5757
}

Parser/Handler/NumberHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function handle(Reader $reader, TokenStream $stream): bool
4747
}
4848

4949
$stream->push(new Token(Token::TYPE_NUMBER, $match[0], $reader->getPosition()));
50-
$reader->moveForward(strlen($match[0]));
50+
$reader->moveForward(\strlen($match[0]));
5151

5252
return true;
5353
}

Parser/Handler/StringHandler.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function handle(Reader $reader, TokenStream $stream): bool
4747
{
4848
$quote = $reader->getSubstring(1);
4949

50-
if (!in_array($quote, array("'", '"'))) {
50+
if (!\in_array($quote, array("'", '"'))) {
5151
return false;
5252
}
5353

@@ -59,18 +59,18 @@ public function handle(Reader $reader, TokenStream $stream): bool
5959
}
6060

6161
// check unclosed strings
62-
if (strlen($match[0]) === $reader->getRemainingLength()) {
62+
if (\strlen($match[0]) === $reader->getRemainingLength()) {
6363
throw SyntaxErrorException::unclosedString($reader->getPosition() - 1);
6464
}
6565

6666
// check quotes pairs validity
67-
if ($quote !== $reader->getSubstring(1, strlen($match[0]))) {
67+
if ($quote !== $reader->getSubstring(1, \strlen($match[0]))) {
6868
throw SyntaxErrorException::unclosedString($reader->getPosition() - 1);
6969
}
7070

7171
$string = $this->escaping->escapeUnicodeAndNewLine($match[0]);
7272
$stream->push(new Token(Token::TYPE_STRING, $string, $reader->getPosition()));
73-
$reader->moveForward(strlen($match[0]) + 1);
73+
$reader->moveForward(\strlen($match[0]) + 1);
7474

7575
return true;
7676
}

Parser/Handler/WhitespaceHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function handle(Reader $reader, TokenStream $stream): bool
3939
}
4040

4141
$stream->push(new Token(Token::TYPE_WHITESPACE, $match[0], $reader->getPosition()));
42-
$reader->moveForward(strlen($match[0]));
42+
$reader->moveForward(\strlen($match[0]));
4343

4444
return true;
4545
}

Parser/Parser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ private function parseSimpleSelector(TokenStream $stream, bool $insideNegation =
150150
{
151151
$stream->skipWhitespace();
152152

153-
$selectorStart = count($stream->getUsed());
153+
$selectorStart = \count($stream->getUsed());
154154
$result = $this->parseElementNode($stream);
155155
$pseudoElement = null;
156156

@@ -187,7 +187,7 @@ private function parseSimpleSelector(TokenStream $stream, bool $insideNegation =
187187
}
188188

189189
$identifier = $stream->getNextIdentifier();
190-
if (in_array(strtolower($identifier), array('first-line', 'first-letter', 'before', 'after'))) {
190+
if (\in_array(strtolower($identifier), array('first-line', 'first-letter', 'before', 'after'))) {
191191
// Special case: CSS 2.1 pseudo-elements can have a single ':'.
192192
// Any new pseudo-element must have two.
193193
$pseudoElement = $identifier;
@@ -253,7 +253,7 @@ private function parseSimpleSelector(TokenStream $stream, bool $insideNegation =
253253
}
254254
}
255255

256-
if (count($stream->getUsed()) === $selectorStart) {
256+
if (\count($stream->getUsed()) === $selectorStart) {
257257
throw SyntaxErrorException::unexpectedToken('selector', $stream->getPeek());
258258
}
259259

Parser/Reader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Reader
3030
public function __construct(string $source)
3131
{
3232
$this->source = $source;
33-
$this->length = strlen($source);
33+
$this->length = \strlen($source);
3434
}
3535

3636
public function isEOF(): bool

Parser/Token.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function isDelimiter(array $values = array()): bool
7272
return true;
7373
}
7474

75-
return in_array($this->value, $values);
75+
return \in_array($this->value, $values);
7676
}
7777

7878
public function isWhitespace(): bool

Parser/Tokenizer/TokenizerEscaping.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ private function replaceUnicodeSequences(string $value): string
5050
$c = hexdec($match[1]);
5151

5252
if (0x80 > $c %= 0x200000) {
53-
return chr($c);
53+
return \chr($c);
5454
}
5555
if (0x800 > $c) {
56-
return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F);
56+
return \chr(0xC0 | $c >> 6).\chr(0x80 | $c & 0x3F);
5757
}
5858
if (0x10000 > $c) {
59-
return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F);
59+
return \chr(0xE0 | $c >> 12).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F);
6060
}
6161
}, $value);
6262
}

0 commit comments

Comments
 (0)