Total Complexity | 9 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
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 | // Empty because this is a Null pattern implementation |
||
33 | } |
||
34 | |||
35 | public function update( |
||
36 | string $message = '', |
||
37 | ?int $value = null, |
||
38 | ?int $total = null, |
||
39 | ?int $startTime = null, |
||
40 | ?int $current = null |
||
41 | ): void { |
||
42 | // Empty because this is a Null pattern implementation |
||
43 | } |
||
44 | |||
45 | public function shouldNotifyChange(Status $current, Status $newStatus): bool |
||
46 | { |
||
47 | return false; |
||
48 | } |
||
49 | |||
50 | public function attach(SplObserver $observer): void |
||
51 | { |
||
52 | // Empty because this is a Null pattern implementation |
||
53 | } |
||
54 | |||
55 | public function detach(SplObserver $observer): void |
||
57 | // Empty because this is a Null pattern implementation |
||
58 | } |
||
59 | |||
60 | public function notify(): void |
||
62 | // Empty because this is a Null pattern implementation |
||
63 | } |
||
64 | } |
||
65 |