ClassicProgress   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 11
c 1
b 1
f 0
dl 0
loc 54
ccs 0
cts 34
cp 0
rs 10
wmc 9

9 Methods

Rating   Name   Duplication   Size   Complexity  
A advance() 0 3 1
A deletePersisted() 0 2 1
A getPersisted() 0 2 1
A __call() 0 3 1
A summary() 0 3 1
A start() 0 3 1
A setSleepModeState() 0 2 1
A setUid() 0 5 1
A setProgressBar() 0 5 1
1
<?php
2
3
namespace Tequilarapido\Consolify\Progress;
4
5
use Symfony\Component\Console\Helper\ProgressBar;
6
7
class ClassicProgress implements Progress
8
{
9
    /** @var ProgressBar */
10
    protected $bar;
11
12
    /** @var string */
13
    protected $uid;
14
15
    public function setProgressBar(ProgressBar $bar)
16
    {
17
        $this->bar = $bar;
18
19
        return $this;
20
    }
21
22
    public function setUid($uid)
23
    {
24
        $this->uid = $uid;
25
26
        return $this;
27
    }
28
29
    public function advance($step = 1)
30
    {
31
        $this->bar->advance($step);
32
    }
33
34
    public function start($max = null)
35
    {
36
        $this->bar->start($max);
37
    }
38
39
    public function setSleepModeState(SleepModeState $sleepModeState)
40
    {
41
        // do nothing
42
    }
43
44
    public function summary()
45
    {
46
        return [];
47
    }
48
49
    public function getPersisted()
50
    {
51
    }
52
53
    public function deletePersisted()
54
    {
55
        // do nothing
56
    }
57
58
    public function __call($name, $arguments)
59
    {
60
        return call_user_func_array([$this->bar, $name], $arguments);
61
    }
62
}
63