• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

brick / lock / 17475241346

04 Sep 2025 07:59PM UTC coverage: 5.5%. Remained the same
17475241346

push

github

BenMorel
Apply coding standard

11 of 200 relevant lines covered (5.5%)

3.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Exception/LockAcquireException.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Brick\Lock\Exception;
6

7
use Throwable;
8

9
use function sprintf;
10

11
/**
12
 * Exception thrown when a lock cannot be acquired due to an error.
13
 * It is ONLY thrown in case of an error: it is NOT thrown when the lock cannot be acquired because it is already held.
14
 * The state of the lock is undefined after such an exception.
15
 */
16
final class LockAcquireException extends LockException
17
{
18
    public static function forLockName(string $lockName, string $errorDescription, ?Throwable $previous = null): self
19
    {
20
        $message = sprintf('Cannot acquire lock with name "%s": %s', $lockName, $errorDescription);
×
21

22
        return new self($message, $previous);
×
23
    }
24

25
    public static function forMultiLock(string $errorDescription, ?Throwable $previous = null): self
26
    {
27
        $message = sprintf('Cannot acquire multi lock: %s', $errorDescription);
×
28

29
        return new self($message, $previous);
×
30
    }
31
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc