Skip to content

Commit a0ad562

Browse files
staabmsebastianbergmann
authored andcommitted
Micro optimize NamePrettifier->prettifyTestMethodName() once again
1 parent 729330a commit a0ad562

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Logging/TestDox/NamePrettifier.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,10 @@ public function prettifyTestMethodName(string $name): string
114114
return '';
115115
}
116116

117-
$string = (string) preg_replace('#\d+$#', '', $name, -1, $count);
118-
117+
$string = rtrim($name, '0123456789');
119118
if (array_key_exists($string, self::$strings)) {
120119
$name = $string;
121-
} elseif ($count === 0) {
120+
} elseif ($string === $name) {
122121
self::$strings[$string] = 1;
123122
}
124123

0 commit comments

Comments
 (0)