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:
parent
7db3e25efe
commit
2e00dfb0c8
@ -58,7 +58,7 @@ class TranslatorHelper extends Helper
|
|||||||
*/
|
*/
|
||||||
public function transChoice($id, $number, array $parameters = [], $domain = 'messages', $locale = null)
|
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) {
|
if (null === $this->translator) {
|
||||||
return $this->doTrans($id, ['%count%' => $number] + $parameters, $domain, $locale);
|
return $this->doTrans($id, ['%count%' => $number] + $parameters, $domain, $locale);
|
||||||
|
@ -34,7 +34,7 @@ class IdentityTranslator implements LegacyTranslatorInterface, TranslatorInterfa
|
|||||||
$this->selector = $selector;
|
$this->selector = $selector;
|
||||||
|
|
||||||
if (__CLASS__ !== \get_class($this)) {
|
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)
|
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) {
|
if ($this->selector) {
|
||||||
return strtr($this->selector->choose((string) $id, $number, $locale ?: $this->getLocale()), $parameters);
|
return strtr($this->selector->choose((string) $id, $number, $locale ?: $this->getLocale()), $parameters);
|
||||||
|
@ -64,7 +64,7 @@ class LoggingTranslator implements TranslatorInterface, LegacyTranslatorInterfac
|
|||||||
*/
|
*/
|
||||||
public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null)
|
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) {
|
if ($this->translator instanceof TranslatorInterface) {
|
||||||
$trans = $this->translator->trans($id, ['%count%' => $number] + $parameters, $domain, $locale);
|
$trans = $this->translator->trans($id, ['%count%' => $number] + $parameters, $domain, $locale);
|
||||||
|
Reference in New Issue
Block a user