Skip to content

Commit

Permalink
Don't implicitly cast glob's return type
Browse files Browse the repository at this point in the history
The comment above mentions that on some platforms, it might return
false, and this is why there is a check in the first place. Let us do
exactly what is mentioned in the comment.
  • Loading branch information
greg0ire committed Feb 20, 2024
1 parent 1c68e28 commit 8cf7f35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Cache/Region/FileLockRegion.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function evictAll(): bool
// when nothing matched (even though no errors occurred)
$filenames = glob(sprintf('%s/*.%s', $this->directory, self::LOCK_EXTENSION));

if ($filenames) {
if ($filenames !== false) {
foreach ($filenames as $filename) {
@unlink($filename);
}
Expand Down

0 comments on commit 8cf7f35

Please sign in to comment.