Completed
Pull Request — master (#39)
by Wachter
24:21
created

NullLock::acquire()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
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\Execution\TaskExecutionInterface;
15
use Task\Lock\LockInterface;
16
17
/**
18
 * Implements LockInterface which does nothing.
19
 */
20
class NullLock implements LockInterface
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function acquire(TaskExecutionInterface $execution)
26
    {
27
        return true;
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function refresh(TaskExecutionInterface $execution)
34
    {
35
        return true;
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function release(TaskExecutionInterface $execution)
42
    {
43
        return true;
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public function isAcquired(TaskExecutionInterface $execution)
50
    {
51
        return false;
52
    }
53
}
54