Completed
Push — develop ( a0bdf0...500e55 )
by Alec
02:54
created

ReportFormatter::wrongReport()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace AlecRabbit\Tools\Reports\Formatters;
4
5
use AlecRabbit\Tools\Contracts\Strings;
6
use AlecRabbit\Tools\Reports\Contracts\ReportInterface;
7
use AlecRabbit\Tools\Reports\Formatters\Contracts\FormatterInterface;
8
use function AlecRabbit\typeOf;
9
10
abstract class ReportFormatter implements FormatterInterface, Strings
11
{
12
    /** {@inheritdoc} */
13
    abstract public function process(ReportInterface $report): string;
14
15
    /**
16
     * @param string $expected
17
     * @param ReportInterface $report
18
     */
19 1
    protected function wrongReport(string $expected, ReportInterface $report): void
20
    {
21 1
        throw new \RuntimeException(
22 1
            'Instance of [' . $expected . '] expected, [' . typeOf($report) . '] given'
23
        );
24
    }
25
}
26