Completed
Push — master ( 4c3d7b...5426a5 )
by Carlos C
02:38
created

NullProgress   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 9
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 61
ccs 9
cts 9
cp 1
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 2
A getStatus() 0 4 1
A increase() 0 3 1
A update() 0 8 1
A shouldNotifyChange() 0 4 1
A attach() 0 3 1
A detach() 0 3 1
A notify() 0 3 1
1
<?php
2
namespace EngineWorks\ProgressStatus;
3
4
use SplObserver;
5
6
/**
7
 * NullProgress is a null object implementation of ProgressInterface.
8
 */
9
class NullProgress implements ProgressInterface
10
{
11
    /** @var Status */
12
    private $status;
13
14 3
    public function __construct(Status $status = null)
15
    {
16 3
        $this->status = $status ? : Status::make();
17 3
    }
18
19 3
    public function getStatus()
20
    {
21 3
        return $this->status;
22
    }
23
24 1
    public function increase($message = null, $increase = 1)
25
    {
26 1
    }
27
28
    /**
29
     * @inheritdoc
30
     * @codeCoverageIgnore null implementation
31
     */
32
    public function update(
33
        $message = null,
34
        $value = null,
35
        $total = null,
36
        $startTime = null,
37
        $current = null
38
    ) {
39
    }
40
41 1
    public function shouldNotifyChange(Status $current, Status $newStatus)
42
    {
43 1
        return false;
44
    }
45
46
    /**
47
     * @inheritdoc
48
     * @codeCoverageIgnore null implementation
49
     */
50
    public function attach(SplObserver $observer)
51
    {
52
    }
53
54
    /**
55
     * @inheritdoc
56
     * @codeCoverageIgnore null implementation
57
     */
58
    public function detach(SplObserver $observer)
59
    {
60
    }
61
62
    /**
63
     * @inheritdoc
64
     * @codeCoverageIgnore null implementation
65
     */
66
    public function notify()
67
    {
68
    }
69
}
70