Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9bf53cd

Browse files
bug#30004 Fix format strings for deprecation notices (TysonAndre)
This PR was merged into the 4.2 branch.Discussion----------Fix format strings for deprecation notices| Q | A| ------------- | ---| Branch? | master for features / 3.4 up to 4.2 for bug fixes <!-- see below -->| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? || Fixed tickets || License | MIT| Doc PR |The `%c` conversion specifier expects an integer(the value of the byte to print). To produce a literal `%`, `%%` should be used.Detected via static analysisCommits-------2e00dfb Fix format strings for deprecation notices
2 parents7db3e25 +2e00dfb commit9bf53cd

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Templating/Helper/TranslatorHelper.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function trans($id, array $parameters = [], $domain = 'messages', $locale
5858
*/
5959
publicfunctiontransChoice($id,$number,array$parameters = [],$domain ='messages',$locale =null)
6060
{
61-
@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);
61+
@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);
6262

6363
if (null ===$this->translator) {
6464
return$this->doTrans($id, ['%count%' =>$number] +$parameters,$domain,$locale);

‎src/Symfony/Component/Translation/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
publicfunctiontransChoice($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
returnstrtr($this->selector->choose((string)$id,$number,$locale ?:$this->getLocale()),$parameters);

‎src/Symfony/Component/Translation/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
publicfunctiontransChoice($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->translatorinstanceof TranslatorInterface) {
7070
$trans =$this->translator->trans($id, ['%count%' =>$number] +$parameters,$domain,$locale);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp