Skip to content

Commit

Permalink
Micro optimize NamePrettifier->prettifyTestMethodName()
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored and sebastianbergmann committed Mar 12, 2024
1 parent d186930 commit c571df3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Logging/TestDox/NamePrettifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ public function prettifyTestMethodName(string $name): string
$wasNumeric = false;

foreach (range(0, strlen($name) - 1) as $i) {
if ($i > 0 && ord($name[$i]) >= 65 && ord($name[$i]) <= 90) {
$ord = ord($name[$i]);

if ($i > 0 && $ord >= 65 && $ord <= 90) {
$buffer .= ' ' . strtolower($name[$i]);
} else {
$isNumeric = is_numeric($name[$i]);
Expand Down

0 comments on commit c571df3

Please sign in to comment.