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

ExtendedCounterReport::buildOn()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 19
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 15
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 16
nc 2
nop 1
dl 0
loc 19
ccs 15
cts 15
cp 1
crap 2
rs 9.7333
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace AlecRabbit\Reports;
4
5
use AlecRabbit\Counters\ExtendedCounter;
6
use AlecRabbit\Reports\Core\AbstractCounterReport;
7
use AlecRabbit\Reports\Core\AbstractReportable;
8
9
class ExtendedCounterReport extends AbstractCounterReport
10
{
11
    /** {@inheritDoc} */
12 2
    protected function extractDataFrom(AbstractReportable $reportable = null): void
13
    {
14 2
        $this->data = [];
15 2
        if ($reportable instanceof ExtendedCounter) {
16 2
            $this->data['name'] = $reportable->getName();
17 2
            $this->data['value'] = $reportable->getValue();
18 2
            $this->data['step'] = $reportable->getStep();
19 2
            $this->data['started'] = $reportable->isStarted();
20 2
            $this->data['initialValue'] = $reportable->getInitialValue();
21 2
            $this->data['bumped'] = $reportable->getBumped();
22 2
            $this->data['max'] = $reportable->getMax();
23 2
            $this->data['min'] = $reportable->getMin();
24 2
            $this->data['path'] = $reportable->getPath();
25 2
            $this->data['length'] = $reportable->getLength();
26 2
            $this->data['diff'] = $reportable->getDiff();
27 2
            $this->data['bumpedBack'] = $reportable->getBumpedBack();
28
        }
29 2
    }
30
}
31