RetryLockStoreDelegatorFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 1
b 0
f 0
ccs 3
cts 3
cp 1
cc 1
nc 1
nop 3
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Shlinkio\Shlink\Common\Lock;
6
7
use Interop\Container\ContainerInterface;
8
use Symfony\Component\Lock\PersistingStoreInterface;
9
use Symfony\Component\Lock\Store\RetryTillSaveStore;
10
11
class RetryLockStoreDelegatorFactory
12
{
13 1
    public function __invoke(ContainerInterface $container, string $name, callable $callback): RetryTillSaveStore
14
    {
15
        /** @var PersistingStoreInterface $originalStore */
16 1
        $originalStore = $callback();
17 1
        return new RetryTillSaveStore($originalStore);
18
    }
19
}
20