Skip to content

Commit

Permalink
Merge pull request #11 from saeedvaziry/fix-match
Browse files Browse the repository at this point in the history
replace match with switch
  • Loading branch information
saeedvaziry authored Mar 5, 2022
2 parents f3f2997 + abced82 commit e2dfb4e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/HasRecords.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ protected function getRecords(array $instances, $duration)
*/
private function getDurationInTime($duration = null)
{
return match ($duration) {
'day' => now()->subDay(),
default => now()->subHour(),
};
switch ($duration) {
case 'day':
return now()->subDay();
default:
return now()->subHour();
}
}

/**
Expand Down

0 comments on commit e2dfb4e

Please sign in to comment.