Fix format strings for deprecation notices

The `%c` conversion specifier expects an integer
(the value of the byte to print)

Detected via static analysis
This commit is contained in:
Tyson Andre 2019-01-27 18:11:39 -05:00
parent 7db3e25efe
commit 2e00dfb0c8
3 changed files with 4 additions and 4 deletions

View File

@ -58,7 +58,7 @@ class TranslatorHelper extends Helper
*/
public function transChoice($id, $number, array $parameters = [], $domain = 'messages', $locale = null)
{
@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);
@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);
if (null === $this->translator) {
return $this->doTrans($id, ['%count%' => $number] + $parameters, $domain, $locale);

View File

@ -34,7 +34,7 @@ class IdentityTranslator implements LegacyTranslatorInterface, TranslatorInterfa
$this->selector = $selector;
if (__CLASS__ !== \get_class($this)) {
@trigger_error(sprintf('Calling "%s()" is deprecated since Symfony 4.2.'), E_USER_DEPRECATED);
@trigger_error(sprintf('Calling "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
}
}
@ -45,7 +45,7 @@ class IdentityTranslator implements LegacyTranslatorInterface, TranslatorInterfa
*/
public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null)
{
@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);
@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);
if ($this->selector) {
return strtr($this->selector->choose((string) $id, $number, $locale ?: $this->getLocale()), $parameters);

View File

@ -64,7 +64,7 @@ class LoggingTranslator implements TranslatorInterface, LegacyTranslatorInterfac
*/
public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null)
{
@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);
@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);
if ($this->translator instanceof TranslatorInterface) {
$trans = $this->translator->trans($id, ['%count%' => $number] + $parameters, $domain, $locale);