Skip to content

Commit 33524c3

Browse files
minor #25752 Don't right trim the deprecation message (alexpott)
This PR was submitted for the 3.4 branch but it was squashed and merged into the 3.3 branch instead (closes #25752). Discussion ---------- Don't right trim the deprecation message | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | maybe yes | New feature? | no | BC breaks? | no | Deprecations? | no <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!--highly recommended for new features--> <!-- - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. - Replace this comment by a description of what your PR is solving. --> The PhpUnit bridge lists deprecation messages after a test. In order to do this it outputs the message but it right trims the message - removing any fullstops. This is unexpected. It does this to add the number of time the message appears but this is not really necessary because the number of the times a deprecation message is triggered and from where is added below. Commits ------- 0b03631 Don't right trim the deprecation message
1 parent cebc0e7 commit 33524c3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

DeprecationErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public static function register($mode = false)
134134
uasort($deprecations[$group], $cmp);
135135

136136
foreach ($deprecations[$group] as $msg => $notices) {
137-
echo "\n", rtrim($msg, '.'), ': ', $notices['count'], "x\n";
137+
echo "\n ", $notices['count'], 'x: ', $msg, "\n";
138138

139139
arsort($notices);
140140

Tests/DeprecationErrorHandler/default.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,20 @@ $foo->testNonLegacyBar();
6363
--EXPECTF--
6464
Unsilenced deprecation notices (3)
6565

66-
unsilenced foo deprecation: 2x
66+
2x: unsilenced foo deprecation
6767
2x in FooTestCase::testLegacyFoo
6868

69-
unsilenced bar deprecation: 1x
69+
1x: unsilenced bar deprecation
7070
1x in FooTestCase::testNonLegacyBar
7171

7272
Remaining deprecation notices (1)
7373

74-
silenced bar deprecation: 1x
74+
1x: silenced bar deprecation
7575
1x in FooTestCase::testNonLegacyBar
7676

7777
Legacy deprecation notices (1)
7878

7979
Other deprecation notices (1)
8080

81-
root deprecation: 1x
81+
1x: root deprecation
8282

0 commit comments

Comments
 (0)