Total Complexity | 5 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Coverage | 87.5% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
12 | abstract class BaseImplementation implements OutputInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var integer |
||
16 | */ |
||
17 | protected $maxValue = 0; |
||
18 | |||
19 | /** |
||
20 | * @var integer |
||
21 | */ |
||
22 | protected $minValue = 0; |
||
23 | |||
24 | /** |
||
25 | * @param array $options |
||
26 | */ |
||
27 | 19 | public function __construct(array $options = []) |
|
29 | } |
||
30 | |||
31 | /** |
||
32 | * {@inheritdoc} |
||
33 | */ |
||
34 | 53 | public function output(int $value): string |
|
35 | { |
||
36 | 53 | $this->validate($value); |
|
37 | |||
38 | 47 | return $this->outputValidValue($value); |
|
39 | } |
||
40 | |||
41 | /** |
||
42 | * Validate given value |
||
43 | * |
||
44 | * @param integer $value |
||
45 | * @return void |
||
46 | */ |
||
47 | 51 | protected function validate(int $value): void |
|
52 | } |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * Serialize a valid value into a character |
||
57 | * |
||
58 | * @param integer $value |
||
59 | * @return string |
||
60 | */ |
||
61 | abstract protected function outputValidValue(int $value): string; |
||
62 | } |