Skip to content

Commit 1071c96

Browse files
committed
Replace switch by match
1 parent e57e5cd commit 1071c96

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/GeoIP.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,10 @@ private function shouldCache(Location $location, $ip = null): bool
291291
return false;
292292
}
293293

294-
switch ($this->config('cache', 'none')) {
295-
case 'all':
296-
case 'some' && $ip === null:
297-
return true;
298-
}
299-
300-
return false;
294+
return match ($this->config('cache', 'none')) {
295+
'all', 'some' && $ip === null => true,
296+
default => false,
297+
};
301298
}
302299

303300
/**

0 commit comments

Comments
 (0)