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

mpyw / laravel-database-advisory-lock / 13646006723

04 Mar 2025 04:06AM UTC coverage: 100.0% (+0.6%) from 99.401%
13646006723

push

github

mpyw
refactor: 💡 Remove useless branch

1 of 1 new or added line in 1 file covered. (100.0%)

164 of 164 relevant lines covered (100.0%)

95.56 hits per line

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

100.0
/src/Concerns/SessionLocks.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Mpyw\LaravelDatabaseAdvisoryLock\Concerns;
6

7
use Mpyw\LaravelDatabaseAdvisoryLock\Contracts\LockFailedException;
8
use Mpyw\LaravelDatabaseAdvisoryLock\Contracts\SessionLock;
9

10
trait SessionLocks
11
{
12
    abstract public function lockOrFail(string $key, float|int $timeout = 0): SessionLock;
13

14
    public function tryLock(string $key, float|int $timeout = 0): ?SessionLock
15
    {
16
        try {
17
            return $this->lockOrFail($key, $timeout);
168✔
18
        } catch (LockFailedException) {
72✔
19
            return null;
56✔
20
        }
21
    }
22
}
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