Skip to content

Commit fc22b11

Browse files
staabmsebastianbergmann
authored andcommitted
simplify
1 parent 9233162 commit fc22b11

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Logging/TestDox/NamePrettifier.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,8 @@ public function prettifyTestClassName(string $className): string
111111
// NOTE: this method is on a hot path and very performance sensitive. change with care.
112112
public function prettifyTestMethodName(string $name): string
113113
{
114-
$buffer = '';
115-
116114
if ($name === '') {
117-
return $buffer;
115+
return '';
118116
}
119117

120118
$string = (string) preg_replace('#\d+$#', '', $name, -1, $count);
@@ -132,7 +130,7 @@ public function prettifyTestMethodName(string $name): string
132130
}
133131

134132
if ($name === '') {
135-
return $buffer;
133+
return '';
136134
}
137135

138136
$name[0] = strtoupper($name[0]);
@@ -144,6 +142,7 @@ public function prettifyTestMethodName(string $name): string
144142

145143
$wasNumeric = false;
146144

145+
$buffer = '';
147146
foreach (range(0, strlen($name) - 1) as $i) {
148147
if ($i > 0 && $name[$i] >= 'A' && $name[$i] <= 'Z') {
149148
$buffer .= ' ' . strtolower($name[$i]);

0 commit comments

Comments
 (0)