Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
AddLockManagerContextBuilder | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
process | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | namespace Apie\Common\ContextBuilders; |
3 | |
4 | use Apie\Core\Context\ApieContext; |
5 | use Apie\Core\ContextBuilders\ContextBuilderInterface; |
6 | use Symfony\Component\Lock\LockFactory; |
7 | use Symfony\Component\Lock\Store\FlockStore; |
8 | |
9 | final class AddLockManagerContextBuilder implements ContextBuilderInterface |
10 | { |
11 | public function __construct( |
12 | private readonly LockFactory $lockFactory = new LockFactory(new FlockStore()) |
13 | ) { |
14 | } |
15 | |
16 | public function process(ApieContext $context): ApieContext |
17 | { |
18 | return $context->withContext( |
19 | LockFactory::class, |
20 | $this->lockFactory |
21 | ); |
22 | } |
23 | } |