Skip to content

Commit

Permalink
fix: Remove the usage of switch statement
Browse files Browse the repository at this point in the history
  • Loading branch information
nahime0 committed Nov 16, 2023
1 parent 0a15ae8 commit fe4eed0
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/Printers/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,12 @@ private function overview(Result $result): void
$successRateAsString = sprintf('%4.1f', $successRate);

$successRateColor = 'red';
switch (true) {
case $successRate > 99:
$successRateColor = 'green';
break;
case $successRate > 75:
$successRateColor = 'yellow';
break;
case $successRate > 50:
$successRateColor = 'orange';
break;
if ($successRate > 99) {
$successRateColor = 'green';
} else if ($successRate > 75) {
$successRateColor = 'yellow';
} else if ($successRate > 50) {
$successRateColor = 'orange';
}

$this->twoColumnDetail('Success Rate', <<<HTML
Expand Down

0 comments on commit fe4eed0

Please sign in to comment.