1 | <?php namespace Arcanesoft\Sidebar; |
||
14 | class Manager implements ManagerContract |
||
15 | { |
||
16 | |||
17 | /* ----------------------------------------------------------------- |
||
18 | | Properties |
||
19 | | ----------------------------------------------------------------- |
||
20 | */ |
||
21 | |||
22 | /** @var \Arcanesoft\Foundation\Helpers\Sidebar\SidebarCollection */ |
||
23 | protected $items; |
||
24 | |||
25 | protected $shown = true; |
||
26 | |||
27 | /* ----------------------------------------------------------------- |
||
28 | | Constructor |
||
29 | | ----------------------------------------------------------------- |
||
30 | */ |
||
31 | |||
32 | 24 | public function __construct() |
|
36 | |||
37 | /* ----------------------------------------------------------------- |
||
38 | | Getters & Setters |
||
39 | | ----------------------------------------------------------------- |
||
40 | */ |
||
41 | |||
42 | /** |
||
43 | * Set the selected item. |
||
44 | * |
||
45 | * @param string $name |
||
46 | * |
||
47 | * @return $this |
||
48 | */ |
||
49 | 4 | public function setSelectedItem(string $name) |
|
55 | |||
56 | /** |
||
57 | * Get the sidebar items. |
||
58 | * |
||
59 | * @return \Arcanesoft\Sidebar\SidebarCollection |
||
60 | */ |
||
61 | 20 | public function items() |
|
65 | |||
66 | /* ----------------------------------------------------------------- |
||
67 | | Main Methods |
||
68 | | ----------------------------------------------------------------- |
||
69 | */ |
||
70 | |||
71 | /** |
||
72 | * Load the sidebar items from config files. |
||
73 | * |
||
74 | * @param array $items |
||
75 | * |
||
76 | * @return $this |
||
77 | */ |
||
78 | 4 | public function loadFromArray(array $items) |
|
88 | |||
89 | /** |
||
90 | * Load sidebar items from config file(s). |
||
91 | * |
||
92 | * @param string $key |
||
93 | * |
||
94 | * @return $this |
||
95 | */ |
||
96 | 8 | public function loadFromConfig($key) |
|
118 | |||
119 | /** |
||
120 | * Add an item from array. |
||
121 | * |
||
122 | * @param array $item |
||
123 | * |
||
124 | * @return $this |
||
125 | */ |
||
126 | 16 | public function add(array $item) |
|
132 | |||
133 | /** |
||
134 | * Show the sidebar. |
||
135 | * |
||
136 | * @return $this |
||
137 | */ |
||
138 | 4 | public function show() |
|
144 | |||
145 | /** |
||
146 | * Hide the sidebar. |
||
147 | * |
||
148 | * @return $this |
||
149 | */ |
||
150 | 4 | public function hide() |
|
156 | |||
157 | /* ----------------------------------------------------------------- |
||
158 | | Check Methods |
||
159 | | ----------------------------------------------------------------- |
||
160 | */ |
||
161 | |||
162 | /** |
||
163 | * Check if the sidebar has items. |
||
164 | * |
||
165 | * @return bool |
||
166 | */ |
||
167 | 12 | public function hasItems() |
|
171 | |||
172 | /** |
||
173 | * Check if the sidebar is shown. |
||
174 | * |
||
175 | * @return bool |
||
176 | */ |
||
177 | 4 | public function isShown() |
|
181 | } |
||
182 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..