Test Setup Failed
Push — master ( 82bc16...cbe1a2 )
by Alec
03:13
created

AbstractReport::extractDataFrom()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace AlecRabbit\Reports\Core;
4
5
use AlecRabbit\Formatters\Contracts\FormatterInterface;
6
use AlecRabbit\Reports\Contracts\ReportInterface;
7
8
abstract class AbstractReport extends Formattable implements ReportInterface
9
{
10
    /** @var array */
11
    protected $data;
12
13
    /** @var null|AbstractReportable */
14
    protected $reportable;
15
16
    public function __construct(FormatterInterface $formatter = null, AbstractReportable $reportable = null)
17
    {
18
        parent::__construct($formatter);
19
        $this->reportable = $reportable;
20
        $this->extractDataFrom($reportable);
21
    }
22
23
    /**
24
     * @param AbstractReportable $reportable
25
     */
26
    protected function extractDataFrom(AbstractReportable $reportable = null): void
27
    {
28
        $this->data = [];
29
    }
30
31
    /**
32
     * @return array
33
     */
34
    public function getData(): array
35
    {
36
        return $this->data;
37
    }
38
39
    /**
40
     * @return mixed
41
     */
42
    public function getReportable()
43
    {
44
        return $this->reportable;
45
    }
46
}
47