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

NullProgress::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 2
eloc 2
nc 2
nop 1
crap 2
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