Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 23fd7aa

Browse files
committed
Fix format strings for deprecation notices
The `%c` conversion specifier expects an integer (the value of the byte to print) Detected via static analysis
1 parent 0475715 commit 23fd7aa

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

IdentityTranslator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(MessageSelector $selector = null)
3434
$this->selector = $selector;
3535

3636
if (__CLASS__ !== \get_class($this)) {
37-
@trigger_error(sprintf('Calling "%s()" is deprecated since Symfony 4.2.'), E_USER_DEPRECATED);
37+
@trigger_error(sprintf('Calling "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
3838
}
3939
}
4040

@@ -45,7 +45,7 @@ public function __construct(MessageSelector $selector = null)
4545
*/
4646
public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null)
4747
{
48-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the trans() one instead with a "%count%" parameter.', __METHOD__), E_USER_DEPRECATED);
48+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the trans() one instead with a "%%count%%" parameter.', __METHOD__), E_USER_DEPRECATED);
4949

5050
if ($this->selector) {
5151
return strtr($this->selector->choose((string) $id, $number, $locale ?: $this->getLocale()), $parameters);

LoggingTranslator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function trans($id, array $parameters = [], $domain = null, $locale = nul
6464
*/
6565
public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null)
6666
{
67-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the trans() one instead with a "%count%" parameter.', __METHOD__), E_USER_DEPRECATED);
67+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the trans() one instead with a "%%count%%" parameter.', __METHOD__), E_USER_DEPRECATED);
6868

6969
if ($this->translator instanceof TranslatorInterface) {
7070
$trans = $this->translator->trans($id, ['%count%' => $number] + $parameters, $domain, $locale);

0 commit comments

Comments
 (0)