Completed
Push — master ( 0ced52...d99b90 )
by Markus
03:30
created

Lock::acquire()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Jellyfish\LockSymfony;
4
5
use Jellyfish\Lock\LockInterface;
6
use Symfony\Component\Lock\LockInterface as SymfonyLockInterface;
7
8
class Lock implements LockInterface
9
{
10
    /**
11
     * @var \Symfony\Component\Lock\LockInterface
12
     */
13
    protected $symfonyLock;
14
15
    /**
16
     * @param \Symfony\Component\Lock\LockInterface $symfonyLock
17
     */
18
    public function __construct(SymfonyLockInterface $symfonyLock)
19
    {
20
        $this->symfonyLock = $symfonyLock;
21
    }
22
23
    /**
24
     * @return bool
25
     */
26
    public function acquire(): bool
27
    {
28
        return $this->symfonyLock->acquire();
29
    }
30
31
    /**
32
     * @return \Jellyfish\Lock\LockInterface
33
     */
34
    public function release(): LockInterface
35
    {
36
        $this->symfonyLock->release();
37
38
        return $this;
39
    }
40
}
41