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

NullLock   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 34
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A acquire() 0 4 1
A refresh() 0 4 1
A release() 0 4 1
A isAcquired() 0 4 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