1 | <?php |
||
2 | |||
3 | namespace Imanghafoori\Widgets\Utils; |
||
4 | |||
5 | class Policies |
||
6 | { |
||
7 | /** |
||
8 | * Detects the widget Should Have Debug Info. |
||
9 | * |
||
10 | * @return bool |
||
11 | */ |
||
12 | 12 | public function widgetShouldHaveDebugInfo(): bool |
|
13 | { |
||
14 | 12 | return config('widgetize.debug_info') && !app()->environment('production'); |
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
15 | } |
||
16 | |||
17 | /** |
||
18 | * The caching is turned off when: |
||
19 | * 1 - we are running tests |
||
20 | * 2 - have disabled it in config file. |
||
21 | * |
||
22 | * @return bool |
||
23 | */ |
||
24 | 16 | public function widgetShouldUseCache(): bool |
|
25 | { |
||
26 | 16 | return config('widgetize.enable_cache') && (! app()->environment('testing')); |
|
27 | } |
||
28 | |||
29 | /** |
||
30 | * Widget Should Be Minified or Not. |
||
31 | * |
||
32 | * @return bool |
||
33 | */ |
||
34 | 12 | public function widgetShouldBeMinified(): bool |
|
35 | { |
||
36 | 12 | return config('widgetize.minify_html') || app()->environment('production'); |
|
37 | } |
||
38 | } |
||
39 |