| Conditions | 8 |
| Paths | 8 |
| Total Lines | 42 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public static function parse($path) |
||
| 13 | { |
||
| 14 | $path = explode(':', $path, 2); |
||
| 15 | |||
| 16 | if (count($path) == 2) |
||
| 17 | { |
||
| 18 | if (head($path) == 'app') |
||
| 19 | { |
||
| 20 | $path = app_path(last($path)); |
||
| 21 | } |
||
| 22 | elseif (head($path) == 'base') |
||
| 23 | { |
||
| 24 | $path = base_path(last($path)); |
||
| 25 | } |
||
| 26 | elseif (head($path) == 'config') |
||
| 27 | { |
||
| 28 | $path = config_path(last($path)); |
||
| 29 | } |
||
| 30 | elseif (head($path) == 'database') |
||
| 31 | { |
||
| 32 | $path = database_path(last($path)); |
||
| 33 | } |
||
| 34 | elseif (head($path) == 'public') |
||
| 35 | { |
||
| 36 | $path = public_path(last($path)); |
||
| 37 | } |
||
| 38 | elseif (head($path) == 'storage') |
||
| 39 | { |
||
| 40 | $path = storage_path(last($path)); |
||
| 41 | } |
||
| 42 | else |
||
| 43 | { |
||
| 44 | $path = head($path); |
||
| 45 | } |
||
| 46 | } |
||
| 47 | else |
||
| 48 | { |
||
| 49 | $path = head($path); |
||
| 50 | } |
||
| 51 | |||
| 52 | return $path; |
||
| 53 | } |
||
| 54 | } |