Skip to content

Commit

Permalink
Do not cast file_put_contents's return type
Browse files Browse the repository at this point in the history
If $lock->value was an empty string, this would fix a bug, but it never
is, it is a uniqid-generated string.
  • Loading branch information
greg0ire committed Feb 20, 2024
1 parent 8cf7f35 commit 555cf62
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 @@ -176,7 +176,7 @@ public function lock(CacheKey $key): Lock|null
$lock = Lock::createLockRead();
$filename = $this->getLockFileName($key);

if (! @file_put_contents($filename, $lock->value, LOCK_EX)) {
if (@file_put_contents($filename, $lock->value, LOCK_EX) === false) {
return null;
}

Expand Down

0 comments on commit 555cf62

Please sign in to comment.