Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Dec 3, 2024
1 parent a7519e0 commit 4840288
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ parameters:
identifier: equal.notAllowed
-
identifier: empty.notAllowed

-
path: 'src/mutex/RedisMutex.php'
identifier: if.condNotBoolean
message: '~^Only booleans are allowed in an if condition, mixed given\.$~'
count: 1
4 changes: 2 additions & 2 deletions src/mutex/FlockMutex.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private function lockBusy()
private function acquireNonBlockingLock(): bool
{
if (!flock($this->fileHandle, \LOCK_EX | \LOCK_NB, $wouldBlock)) {
if ($wouldBlock) {
if ($wouldBlock) { // @phpstan-ignore if.condNotBoolean
// Another process holds the lock.
return false;
}
Expand Down Expand Up @@ -163,7 +163,7 @@ protected function lock(): void
return;
}

throw new \RuntimeException("Unknown strategy '{$this->strategy}'.'");
throw new \RuntimeException("Unknown strategy '{$this->strategy}'.'"); // @phpstan-ignore deadCode.unreachable
}

/**
Expand Down

0 comments on commit 4840288

Please sign in to comment.