Skip to content

Commit 84c06b5

Browse files
committed
Prefix all sprintf() calls
1 parent 1c7cee8 commit 84c06b5

23 files changed

+49
-49
lines changed

Exception/SyntaxErrorException.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ class SyntaxErrorException extends ParseException
2525
{
2626
public static function unexpectedToken(string $expectedValue, Token $foundToken): self
2727
{
28-
return new self(sprintf('Expected %s, but %s found.', $expectedValue, $foundToken));
28+
return new self(\sprintf('Expected %s, but %s found.', $expectedValue, $foundToken));
2929
}
3030

3131
public static function pseudoElementFound(string $pseudoElement, string $unexpectedLocation): self
3232
{
33-
return new self(sprintf('Unexpected pseudo-element "::%s" found %s.', $pseudoElement, $unexpectedLocation));
33+
return new self(\sprintf('Unexpected pseudo-element "::%s" found %s.', $pseudoElement, $unexpectedLocation));
3434
}
3535

3636
public static function unclosedString(int $position): self
3737
{
38-
return new self(sprintf('Unclosed/invalid string at %s.', $position));
38+
return new self(\sprintf('Unclosed/invalid string at %s.', $position));
3939
}
4040

4141
public static function nestedNot(): self
@@ -45,7 +45,7 @@ public static function nestedNot(): self
4545

4646
public static function notAtTheStartOfASelector(string $pseudoElement): self
4747
{
48-
return new self(sprintf('Got immediate child pseudo-element ":%s" not at the start of a selector', $pseudoElement));
48+
return new self(\sprintf('Got immediate child pseudo-element ":%s" not at the start of a selector', $pseudoElement));
4949
}
5050

5151
public static function stringAsFunctionArgument(): self

Node/AttributeNode.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function __toString(): string
6767
$attribute = $this->namespace ? $this->namespace.'|'.$this->attribute : $this->attribute;
6868

6969
return 'exists' === $this->operator
70-
? sprintf('%s[%s[%s]]', $this->getNodeName(), $this->selector, $attribute)
71-
: sprintf("%s[%s[%s %s '%s']]", $this->getNodeName(), $this->selector, $attribute, $this->operator, $this->value);
70+
? \sprintf('%s[%s[%s]]', $this->getNodeName(), $this->selector, $attribute)
71+
: \sprintf("%s[%s[%s %s '%s']]", $this->getNodeName(), $this->selector, $attribute, $this->operator, $this->value);
7272
}
7373
}

Node/ClassNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ public function getSpecificity(): Specificity
4646

4747
public function __toString(): string
4848
{
49-
return sprintf('%s[%s.%s]', $this->getNodeName(), $this->selector, $this->name);
49+
return \sprintf('%s[%s.%s]', $this->getNodeName(), $this->selector, $this->name);
5050
}
5151
}

Node/CombinedSelectorNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ public function __toString(): string
5454
{
5555
$combinator = ' ' === $this->combinator ? '<followed>' : $this->combinator;
5656

57-
return sprintf('%s[%s %s %s]', $this->getNodeName(), $this->selector, $combinator, $this->subSelector);
57+
return \sprintf('%s[%s %s %s]', $this->getNodeName(), $this->selector, $combinator, $this->subSelector);
5858
}
5959
}

Node/ElementNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ public function __toString(): string
4848
{
4949
$element = $this->element ?: '*';
5050

51-
return sprintf('%s[%s]', $this->getNodeName(), $this->namespace ? $this->namespace.'|'.$element : $element);
51+
return \sprintf('%s[%s]', $this->getNodeName(), $this->namespace ? $this->namespace.'|'.$element : $element);
5252
}
5353
}

Node/FunctionNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ public function __toString(): string
6565
{
6666
$arguments = implode(', ', array_map(fn (Token $token) => "'".$token->getValue()."'", $this->arguments));
6767

68-
return sprintf('%s[%s:%s(%s)]', $this->getNodeName(), $this->selector, $this->name, $arguments ? '['.$arguments.']' : '');
68+
return \sprintf('%s[%s:%s(%s)]', $this->getNodeName(), $this->selector, $this->name, $arguments ? '['.$arguments.']' : '');
6969
}
7070
}

Node/HashNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ public function getSpecificity(): Specificity
4646

4747
public function __toString(): string
4848
{
49-
return sprintf('%s[%s#%s]', $this->getNodeName(), $this->selector, $this->id);
49+
return \sprintf('%s[%s#%s]', $this->getNodeName(), $this->selector, $this->id);
5050
}
5151
}

Node/MatchingNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ public function __toString(): string
5050
$this->arguments,
5151
);
5252

53-
return sprintf('%s[%s:is(%s)]', $this->getNodeName(), $this->selector, implode(', ', $selectorArguments));
53+
return \sprintf('%s[%s:is(%s)]', $this->getNodeName(), $this->selector, implode(', ', $selectorArguments));
5454
}
5555
}

Node/NegationNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ public function getSpecificity(): Specificity
4646

4747
public function __toString(): string
4848
{
49-
return sprintf('%s[%s:not(%s)]', $this->getNodeName(), $this->selector, $this->subSelector);
49+
return \sprintf('%s[%s:not(%s)]', $this->getNodeName(), $this->selector, $this->subSelector);
5050
}
5151
}

Node/PseudoNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ public function getSpecificity(): Specificity
4949

5050
public function __toString(): string
5151
{
52-
return sprintf('%s[%s:%s]', $this->getNodeName(), $this->selector, $this->identifier);
52+
return \sprintf('%s[%s:%s]', $this->getNodeName(), $this->selector, $this->identifier);
5353
}
5454
}

0 commit comments

Comments
 (0)