| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2.0116 |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | 4 | public static function getContinents($country_id) |
|
| 32 | { |
||
| 33 | // All the contients |
||
| 34 | 4 | if ($country_id == null){ |
|
| 35 | 4 | $minutes = 15; |
|
| 36 | $ret = Cache::remember('continents_list', $minutes, function () { |
||
| 37 | 4 | return self::orderBy('name')->pluck('name', 'id'); |
|
| 38 | 4 | }); |
|
| 39 | } |
||
| 40 | // The contient of a specified country |
||
| 41 | else { |
||
| 42 | $ret = self::firstWhere('id', $country_id); |
||
| 43 | //where('id', $country_id)->first(); |
||
| 44 | //->pluck('name', 'id'); |
||
| 45 | } |
||
| 46 | |||
| 47 | 4 | return $ret; |
|
| 48 | } |
||
| 50 |