| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | 3 | public static function getShortId($categories, Tournament $tournament) |
|
| 10 | { |
||
| 11 | 3 | $competitor = static::where('user_id', Auth::user()->id) |
|
| 12 | 3 | ->whereIn('championship_id', $categories)->first(); |
|
| 13 | |||
| 14 | 3 | if ($competitor != null) { |
|
| 15 | 1 | return $competitor->short_id; |
|
|
|
|||
| 16 | } |
||
| 17 | 3 | return $tournament->competitors()->max('short_id') + 1; |
|
| 18 | } |
||
| 46 |