| Total Complexity | 4 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php declare(strict_types=1); |
||
| 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 | 4 | public function __construct(FormatterInterface $formatter = null, AbstractReportable $reportable = null) |
|
| 17 | { |
||
| 18 | 4 | parent::__construct($formatter); |
|
| 19 | 4 | $this->reportable = $reportable; |
|
| 20 | 4 | $this->extractDataFrom($reportable); |
|
| 21 | 4 | } |
|
| 22 | |||
| 23 | /** |
||
| 24 | * @param AbstractReportable $reportable |
||
| 25 | */ |
||
| 26 | 3 | protected function extractDataFrom(AbstractReportable $reportable = null): void |
|
| 27 | { |
||
| 28 | 3 | $this->data = []; |
|
| 29 | 3 | } |
|
| 30 | |||
| 31 | /** |
||
| 32 | * @return array |
||
| 33 | */ |
||
| 34 | 1 | public function getData(): array |
|
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return mixed |
||
| 41 | */ |
||
| 42 | 2 | public function getReportable() |
|
| 47 |