NullProgress::notify()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EngineWorks\ProgressStatus;
6
7
use SplObserver;
8
9
/**
10
 * NullProgress is a null object implementation of ProgressInterface.
11
 *
12
 * @infection-ignore-all
13
 * @codeCoverageIgnore Null implementation
14
 */
15
class NullProgress implements ProgressInterface
16
{
17
    /** @var Status */
18
    private $status;
19
20
    public function __construct(Status $status = null)
21
    {
22
        $this->status = $status ?: Status::make();
23
    }
24
25
    public function getStatus(): Status
26
    {
27
        return $this->status;
28
    }
29
30
    public function increase(string $message = '', $increase = 1): void
31
    {
32
    }
33
34
    /**
35
     * @inheritdoc
36
     */
37
    public function update(
38
        string $message = null,
39
        $value = null,
40
        $total = null,
41
        int $startTime = null,
42
        int $current = null
43
    ): void {
44
    }
45
46
    public function shouldNotifyChange(Status $current, Status $newStatus): bool
47
    {
48
        return false;
49
    }
50
51
    public function attach(SplObserver $observer): void
52
    {
53
    }
54
55
    public function detach(SplObserver $observer): void
56
    {
57
    }
58
59
    public function notify(): void
60
    {
61
    }
62
}
63