| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 2 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | function widgetShouldUseCache() |
||
| 20 | { |
||
| 21 | /* |
||
| 22 | * ================================== * |
||
| 23 | | The caching is turned off when: | |
||
| 24 | | 1- we are running tests | |
||
| 25 | | 2- have disabled it in .env file | |
||
| 26 | | 3- have set the time to 0 minutes | |
||
| 27 | * ================================== * |
||
| 28 | */ |
||
| 29 | return ((env('WIDGET_CACHE', false) !== false) and (!app()->environment('testing'))); |
||
| 30 | } |
||
| 31 | |||
| 39 | } |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.