1 | <?php |
||
7 | class Flare |
||
8 | { |
||
9 | /** |
||
10 | * The Flare version. |
||
11 | * |
||
12 | * @var string |
||
13 | */ |
||
14 | const VERSION = '1.0'; |
||
15 | |||
16 | /** |
||
17 | * Array of expected configuration keys |
||
18 | * with the absolute bare-minimum defaults. |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | protected $configurationKeys = [ |
||
23 | 'admin_title' => 'Laravel Flare', |
||
24 | 'admin_url' => 'admin', |
||
25 | 'admin_theme' => 'red', |
||
26 | 'admin' => [], |
||
27 | 'attributes' => [], |
||
28 | 'models' => [], |
||
29 | 'modules' => [], |
||
30 | 'widgets' => [], |
||
31 | 'permissions' => \LaravelFlare\Flare\Permissions\Permissions::class, |
||
32 | 'policies' => [], |
||
33 | 'show' => [ |
||
34 | 'github' => true, |
||
35 | 'login' => true, |
||
36 | 'notifications' => true, |
||
37 | 'version' => true, |
||
38 | ], |
||
39 | ]; |
||
40 | |||
41 | /** |
||
42 | * Array of Helper Methods. |
||
43 | * |
||
44 | * @var array |
||
45 | */ |
||
46 | protected $helpers = [ |
||
47 | 'admin' => \LaravelFlare\Flare\Admin\AdminManager::class, |
||
48 | 'permissions' => \LaravelFlare\Flare\Contracts\Permissions\Permissionable::class, |
||
49 | ]; |
||
50 | |||
51 | /** |
||
52 | * Application Instance. |
||
53 | * |
||
54 | * @var \Illuminate\Foundation\Application |
||
55 | */ |
||
56 | protected $app; |
||
57 | |||
58 | /** |
||
59 | * Flare Configuration. |
||
60 | * |
||
61 | * @var array |
||
62 | */ |
||
63 | protected $config; |
||
64 | |||
65 | /** |
||
66 | * The Title of the Admin Panel. |
||
67 | * |
||
68 | * @var string |
||
69 | */ |
||
70 | protected $adminTitle; |
||
71 | |||
72 | /** |
||
73 | * Safe Title of the Admin Panel. |
||
74 | * |
||
75 | * @var string |
||
76 | */ |
||
77 | protected $safeAdminTitle; |
||
78 | |||
79 | /** |
||
80 | * Relative Base URL of Admin Panel. |
||
81 | * |
||
82 | * @var string |
||
83 | */ |
||
84 | protected $relativeAdminUrl; |
||
85 | |||
86 | /** |
||
87 | * __construct. |
||
88 | * |
||
89 | * @param \Illuminate\Foundation\Application $app |
||
90 | */ |
||
91 | public function __construct(Application $app) |
||
97 | |||
98 | /** |
||
99 | * Returns the Application Instance. |
||
100 | * |
||
101 | * @return mixed |
||
102 | */ |
||
103 | public function app() |
||
107 | |||
108 | /** |
||
109 | * Returns a Flare configuration value(s). |
||
110 | * |
||
111 | * @param string $key |
||
112 | * |
||
113 | * @return mixed |
||
114 | */ |
||
115 | public function config($key) |
||
119 | |||
120 | /** |
||
121 | * Returns a Flare configuration value(s), falling back |
||
122 | * to the defined bare-minimum configuration defaults |
||
123 | * if, for whatever reason the config is undefined. |
||
124 | * |
||
125 | * @param string $key |
||
126 | * |
||
127 | * @return mixed |
||
128 | */ |
||
129 | public function getConfig($key) |
||
137 | |||
138 | /** |
||
139 | * Allow setting of the Flare config at runtime. |
||
140 | */ |
||
141 | public function setConfig() |
||
144 | |||
145 | /** |
||
146 | * Set the loaded config to the protected property. |
||
147 | * |
||
148 | * Defaults to the configuration provided in this file |
||
149 | * (the bare minimum) if no config is found available. |
||
150 | */ |
||
151 | public function setLoadedConfig() |
||
161 | |||
162 | /** |
||
163 | * @return string |
||
164 | * |
||
165 | * @deprecated 0.9 Use getAdminTitle() instead. |
||
166 | */ |
||
167 | public function adminTitle() |
||
171 | |||
172 | /** |
||
173 | * Returns the defined Admin Title. |
||
174 | * |
||
175 | * @return string |
||
176 | */ |
||
177 | public function getAdminTitle() |
||
181 | |||
182 | /** |
||
183 | * Sets the Admin Title. |
||
184 | * |
||
185 | * @param mixed $title |
||
186 | */ |
||
187 | public function setAdminTitle($title = null) |
||
191 | |||
192 | /** |
||
193 | * @return string |
||
194 | * |
||
195 | * @deprecated 0.9 Use getSafeAdminTitle() instead. |
||
196 | */ |
||
197 | public function safeAdminTitle() |
||
201 | |||
202 | /** |
||
203 | * Returns the defined Admin Title, converted |
||
204 | * to a safer format (for <title> tags etc.). |
||
205 | * |
||
206 | * @return string |
||
207 | */ |
||
208 | public function getSafeAdminTitle() |
||
212 | |||
213 | /** |
||
214 | * Sets the Safe Admin Title which is used |
||
215 | * in <title> tags etc. |
||
216 | * |
||
217 | * @param mixed $title |
||
218 | */ |
||
219 | public function setSafeAdminTitle($title = null) |
||
223 | |||
224 | /** |
||
225 | * Returns URL to a path in the Admin Panel, using the |
||
226 | * Admin URL defined in the Flare Config. |
||
227 | * |
||
228 | * @param string $path |
||
229 | * |
||
230 | * @return string |
||
231 | */ |
||
232 | public function adminUrl($path = '') |
||
236 | |||
237 | /** |
||
238 | * Returns URL to a path in the Admin Panel, using the |
||
239 | * Admin URL defined in the Flare Config. |
||
240 | * |
||
241 | * @param string $path |
||
242 | * |
||
243 | * @return string |
||
244 | */ |
||
245 | public function relativeAdminUrl($path = '') |
||
249 | |||
250 | /** |
||
251 | * Returns URL to a path in the Admin Panel, using the |
||
252 | * Admin URL defined in the Flare Config. |
||
253 | * |
||
254 | * @return string |
||
255 | */ |
||
256 | public function getRelativeAdminUrl() |
||
260 | |||
261 | /** |
||
262 | * Set the Flare Relative Admin URL. |
||
263 | * |
||
264 | * If the provided path is null the relative path provided |
||
265 | * with the getRelativeAdminUrl() method will return the |
||
266 | * configuration file default (or the Flare fallbacks). |
||
267 | * |
||
268 | * @param mixed $path |
||
269 | */ |
||
270 | public function setRelativeAdminUrl($path = null) |
||
274 | |||
275 | /** |
||
276 | * Returns URL to a path in the Flare Documentation. |
||
277 | * This is COMING SOON! |
||
278 | * |
||
279 | * @param string $path |
||
280 | * |
||
281 | * @return string |
||
282 | */ |
||
283 | public function docsUrl($path = '') |
||
287 | |||
288 | /** |
||
289 | * Takes a named route inside the Flare namespace |
||
290 | * and returns the URL. |
||
291 | * |
||
292 | * @return string |
||
293 | */ |
||
294 | public function route() |
||
297 | |||
298 | /** |
||
299 | * Determines whether part of the Flare Admin Panel |
||
300 | * should be displayed or not and returns true / false. |
||
301 | * |
||
302 | * @param string $key |
||
303 | * |
||
304 | * @return bool |
||
305 | */ |
||
306 | public function show($key = false) |
||
314 | |||
315 | /** |
||
316 | * Determines whether part of the Flare Admin Panel |
||
317 | * should be displayed or not and returns true / false. |
||
318 | * |
||
319 | * Accessor for getShow(). |
||
320 | * |
||
321 | * @param string $key |
||
322 | * |
||
323 | * @return bool |
||
324 | */ |
||
325 | public function getShow($key = false) |
||
331 | |||
332 | /** |
||
333 | * Returns the current Flare Version. |
||
334 | * |
||
335 | * @return string |
||
336 | */ |
||
337 | public function version() |
||
341 | |||
342 | /** |
||
343 | * Returns the compatibility version of Flare to use. |
||
344 | * |
||
345 | * This will either return 'LTS' for Laravel installs of |
||
346 | * the Long Term Support branch (5.1.x) or 'Edge' for all |
||
347 | * other versions (including dev-master). |
||
348 | * |
||
349 | * @return string |
||
350 | */ |
||
351 | public function compatibility() |
||
359 | |||
360 | /** |
||
361 | * Register a helper method. |
||
362 | */ |
||
363 | public function registerHelper($helper, $class) |
||
371 | |||
372 | /** |
||
373 | * Unregister a helper method. |
||
374 | * |
||
375 | * @param string $helper |
||
376 | */ |
||
377 | public function unregisterHelper($helper) |
||
381 | |||
382 | /** |
||
383 | * Call a Helper Method. |
||
384 | * |
||
385 | * @param string $method |
||
386 | * @param mixed $parameters |
||
387 | * |
||
388 | * @return mixed |
||
389 | */ |
||
390 | protected function callHelperMethod($method, $parameters) |
||
394 | |||
395 | /** |
||
396 | * Provide access to Helper Methods. |
||
397 | * |
||
398 | * This provides an extensible way of adding helper classes |
||
399 | * which are registerable and available to adccess through |
||
400 | * the Flare Facade. |
||
401 | * |
||
402 | * @param string $method |
||
403 | * @param array $parameters |
||
404 | * |
||
405 | * @return mixed |
||
406 | */ |
||
407 | public function __call($method, $parameters) |
||
415 | } |
||
416 |
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..