Total Complexity | 3 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | abstract class VariableInfo_Renderer |
||
8 | { |
||
9 | /** |
||
10 | * @var mixed |
||
11 | */ |
||
12 | protected $value; |
||
13 | |||
14 | /** |
||
15 | * @var VariableInfo |
||
16 | */ |
||
17 | protected $info; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $type; |
||
23 | |||
24 | public function __construct(VariableInfo $info) |
||
25 | { |
||
26 | $this->info = $info; |
||
27 | $this->type = $info->getType(); |
||
28 | |||
29 | $this->init(); |
||
30 | } |
||
31 | |||
32 | abstract protected function init(); |
||
33 | |||
34 | /** |
||
35 | * Renders the value to the target format. |
||
36 | * |
||
37 | * @return mixed |
||
38 | */ |
||
39 | public function render() |
||
40 | { |
||
41 | return $this->_render(); |
||
42 | } |
||
43 | |||
44 | abstract protected function _render(); |
||
45 | |||
46 | protected function cutString(string $string) : string |
||
51 | } |
||
52 | } |
||
53 |