Total Complexity | 7 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
10 | abstract class AbstractObservation |
||
11 | { |
||
12 | private $context = []; |
||
13 | protected $message = ''; |
||
14 | |||
15 | abstract public function getPenalty(): float; |
||
16 | |||
17 | public function __construct(?string ...$context) |
||
18 | { |
||
19 | $this->context = $context; |
||
20 | } |
||
21 | |||
22 | public function getMessage(): string |
||
23 | { |
||
24 | return vsprintf($this->message, $this->context); |
||
25 | } |
||
26 | |||
27 | public function __toString(): string |
||
28 | { |
||
29 | return $this->getMessage(); |
||
30 | } |
||
31 | |||
32 | public function isError(): bool |
||
33 | { |
||
34 | return false; |
||
35 | } |
||
36 | |||
37 | public function isWarning(): bool |
||
40 | } |
||
41 | |||
42 | public function isInfo(): bool |
||
45 | } |
||
46 | |||
47 | public function isKudos(): bool |
||
50 | } |
||
51 | } |
||
52 |