Skip to content

Commit c2dfbf9

Browse files
committed
Enable the fixer enforcing fully-qualified calls for compiler-optimized functions
1 parent 3cdc270 commit c2dfbf9

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()
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)
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)
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)
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)
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)
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)
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
@@ -169,7 +169,7 @@ private function parseSimpleSelector(TokenStream $stream, $insideNegation = fals
169169
{
170170
$stream->skipWhitespace();
171171

172-
$selectorStart = count($stream->getUsed());
172+
$selectorStart = \count($stream->getUsed());
173173
$result = $this->parseElementNode($stream);
174174
$pseudoElement = null;
175175

@@ -206,7 +206,7 @@ private function parseSimpleSelector(TokenStream $stream, $insideNegation = fals
206206
}
207207

208208
$identifier = $stream->getNextIdentifier();
209-
if (in_array(strtolower($identifier), array('first-line', 'first-letter', 'before', 'after'))) {
209+
if (\in_array(strtolower($identifier), array('first-line', 'first-letter', 'before', 'after'))) {
210210
// Special case: CSS 2.1 pseudo-elements can have a single ':'.
211211
// Any new pseudo-element must have two.
212212
$pseudoElement = $identifier;
@@ -272,7 +272,7 @@ private function parseSimpleSelector(TokenStream $stream, $insideNegation = fals
272272
}
273273
}
274274

275-
if (count($stream->getUsed()) === $selectorStart) {
275+
if (\count($stream->getUsed()) === $selectorStart) {
276276
throw SyntaxErrorException::unexpectedToken('selector', $stream->getPeek());
277277
}
278278

Parser/Reader.php

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

3939
/**

Parser/Token.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function isDelimiter(array $values = array())
9292
return true;
9393
}
9494

95-
return in_array($this->value, $values);
95+
return \in_array($this->value, $values);
9696
}
9797

9898
/**

Parser/Tokenizer/TokenizerEscaping.php

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

6767
if (0x80 > $c %= 0x200000) {
68-
return chr($c);
68+
return \chr($c);
6969
}
7070
if (0x800 > $c) {
71-
return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F);
71+
return \chr(0xC0 | $c >> 6).\chr(0x80 | $c & 0x3F);
7272
}
7373
if (0x10000 > $c) {
74-
return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F);
74+
return \chr(0xE0 | $c >> 12).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F);
7575
}
7676
}, $value);
7777
}

0 commit comments

Comments
 (0)