Completed
Push — master ( 32d2b8...7fbd09 )
by Alec
03:03
created

Report::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * User: alec
4
 * Date: 29.11.18
5
 * Time: 20:57
6
 */
7
8
namespace AlecRabbit\Tools\Reports\Base;
9
10
use AlecRabbit\Tools\Reports\Contracts\ReportableInterface;
11
use AlecRabbit\Tools\Reports\Contracts\ReportInterface;
12
use AlecRabbit\Tools\Reports\Factory;
13
14
abstract class Report implements ReportInterface
15
{
16
17
    protected $formatter;
18
19 9
    public function __construct()
20
    {
21 9
        $this->formatter = Factory::makeFormatter($this);
22 9
    }
23
24
    /**
25
     * @return string
26
     */
27 2
    public function __toString(): string
28
    {
29
        return
30 2
            $this->formatter->getString();
31
    }
32
}
33