Skip to content

Commit e8d048e

Browse files
minor #29479 Fix TransChoiceTokenParser deprecation message (fbourigault)
This PR was merged into the 4.2 branch. Discussion ---------- Fix TransChoiceTokenParser deprecation message | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A While debugging a `cache:clear`, I found the following errors on stderr: ``` PHP Warning: sprintf(): Too few arguments in .../vendor/symfony/twig-bridge/TokenParser/TransChoiceTokenParser.php on line 43 ``` This was caused by using unescaped `%` in the `sprintf` format string. This fix the `sprintf` format string so the deprecation message will now works. Commits ------- 3d3b3ced48 fix TransChoiceTokenParser deprecation message
2 parents 7c99a70 + af54dbb commit e8d048e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

TokenParser/TransChoiceTokenParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function parse(Token $token)
4040
$lineno = $token->getLine();
4141
$stream = $this->parser->getStream();
4242

43-
@trigger_error(sprintf('The "transchoice" tag is deprecated since Symfony 4.2, use the "trans" one instead with a "%count%" parameter in %s line %d.', $stream->getSourceContext()->getName(), $lineno), E_USER_DEPRECATED);
43+
@trigger_error(sprintf('The "transchoice" tag is deprecated since Symfony 4.2, use the "trans" one instead with a "%%count%%" parameter in %s line %d.', $stream->getSourceContext()->getName(), $lineno), E_USER_DEPRECATED);
4444

4545
$vars = new ArrayExpression(array(), $lineno);
4646

0 commit comments

Comments
 (0)