Completed
Push — master ( 454108...fbd2bc )
by Alexander
09:20 queued 03:33
created

NullLock::isAcquired()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
/*
4
 * This file is part of php-task library.
5
 *
6
 * (c) php-task
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Task\TaskBundle\Locking;
13
14
use Task\Lock\LockInterface;
15
16
/**
17
 * Implements LockInterface which does nothing.
18
 */
19
class NullLock implements LockInterface
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function acquire($task)
25
    {
26
        return true;
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function refresh($task)
33
    {
34
        return true;
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function release($task)
41
    {
42
        return true;
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function isAcquired($task)
49
    {
50
        return false;
51
    }
52
}
53