Total Complexity | 4 |
Total Lines | 62 |
Duplicated Lines | 0 % |
Coverage | 77.78% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
8 | abstract class Directive |
||
9 | { |
||
10 | |||
11 | /** |
||
12 | * @var Flow |
||
13 | */ |
||
14 | protected $flow; |
||
15 | |||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $data; |
||
20 | |||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $operator; |
||
25 | |||
26 | /** |
||
27 | * Directive constructor. |
||
28 | * |
||
29 | * @param Flow $flow |
||
30 | * @param array $data |
||
31 | * @param array $operator |
||
32 | */ |
||
33 | 13 | public function __construct(Flow $flow, array $data, array $operator) |
|
34 | { |
||
35 | 13 | $this->flow = $flow; |
|
36 | 13 | $this->data = $data; |
|
37 | 13 | $this->operator = $operator; |
|
38 | 13 | } |
|
39 | |||
40 | /** |
||
41 | * @return string |
||
42 | */ |
||
43 | 6 | protected function randVariable(): string |
|
44 | { |
||
45 | 6 | return '$_' . Str::random(16); |
|
46 | } |
||
47 | |||
48 | /** |
||
49 | * @codeCoverageIgnore |
||
50 | * |
||
51 | * @return string |
||
52 | */ |
||
53 | public function endDirective(): string |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @return string |
||
60 | */ |
||
61 | public function __toString() |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * @return string |
||
68 | */ |
||
69 | abstract public function render(): string; |
||
70 | |||
72 |