Passed
Push — master ( a2b1bc...228ac7 )
by Alec
03:07
created

SimpleCounterReport   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 13
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A extractDataFrom() 0 10 2
1
<?php declare(strict_types=1);
2
3
namespace AlecRabbit\Reports;
4
5
use AlecRabbit\Counters\SimpleCounter;
6
use AlecRabbit\Reports\Core\AbstractCounterReport;
7
use AlecRabbit\Reports\Core\AbstractReportable;
8
9
class SimpleCounterReport extends AbstractCounterReport
10
{
11
    /** {@inheritDoc} */
12 6
    protected function extractDataFrom(AbstractReportable $reportable = null): void
13
    {
14 6
        $this->data = [];
15 6
        if ($reportable instanceof SimpleCounter) {
16 6
            $this->data['name'] = $reportable->getName();
17 6
            $this->data['value'] = $reportable->getValue();
18 6
            $this->data['step'] = $reportable->getStep();
19 6
            $this->data['started'] = $reportable->isStarted();
20 6
            $this->data['initialValue'] = $reportable->getInitialValue();
21 6
            $this->data['bumped'] = $reportable->getBumped();
22
        }
23 6
    }
24
}
25