| Conditions | 5 |
| Paths | 8 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 5.1158 |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | function cache_path($path = null) |
||
| 9 | { |
||
| 10 | 7 | $base = '/tmp'; |
|
| 11 | |||
| 12 | 7 | if (defined('CACHE_PATH')) { |
|
| 13 | 7 | $base = CACHE_PATH; |
|
| 14 | } |
||
| 15 | |||
| 16 | 7 | if (function_exists('app') && app()->has('path.storage')) { |
|
| 17 | $base = app('path.storage').DIRECTORY_SEPARATOR.'cache'; |
||
| 18 | } |
||
| 19 | |||
| 20 | 7 | return $base.($path ? DIRECTORY_SEPARATOR.$path : $path); |
|
| 21 | } |
||
| 22 | } |
||
| 38 |