Total Complexity | 10 |
Total Lines | 74 |
Duplicated Lines | 0 % |
Coverage | 86.96% |
Changes | 0 |
1 | <?php |
||
13 | class HelpersCollection extends AbstractCollection |
||
14 | { |
||
15 | protected static $instance = null; |
||
16 | |||
17 | /** |
||
18 | * @var View |
||
19 | */ |
||
20 | protected $engine = null; |
||
21 | |||
22 | |||
23 | /** |
||
24 | * @param $name |
||
25 | * @return mixed |
||
26 | */ |
||
27 | 1 | public function getHelper($name) |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * @param $name |
||
38 | * @return bool |
||
39 | */ |
||
40 | 1 | public function hasHelper($name) |
|
41 | { |
||
42 | 1 | if (!$this->has($name)) { |
|
43 | 1 | $this->initHelper($name); |
|
44 | } |
||
45 | |||
46 | 1 | return is_object($this->get($name, null)); |
|
47 | } |
||
48 | |||
49 | /** |
||
50 | * @param $name |
||
51 | */ |
||
52 | 1 | public function initHelper($name) |
|
60 | 1 | } |
|
61 | |||
62 | /** |
||
63 | * @return View |
||
64 | */ |
||
65 | 1 | public function getEngine(): View |
|
68 | } |
||
69 | |||
70 | /** |
||
71 | * @param View $engine |
||
72 | */ |
||
73 | 6 | public function setEngine(View $engine): void |
|
76 | 6 | } |
|
77 | |||
78 | /** |
||
79 | * @return self |
||
80 | */ |
||
81 | 6 | public static function getInstance() |
|
89 |