Passed
Pull Request — master (#53)
by
unknown
05:24
created

FightController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 15
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 8 1
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use App\Grade;
6
use App\Tournament;
7
use Illuminate\Http\Request;
8
9
class FightController extends Controller
10
{
11
    /**
12
     * Display a listing of the fights.
13
     *
14
     * @return \Illuminate\Http\Response
15
     */
16
    public function index(Request $request)
17
    {
18
        $grades = Grade::getAllPlucked();
19
        $tournament = Tournament::with(['championships.firstRoundFights' => function ($query) {
20
            $query->with(['competitor1.user', 'competitor2.user', 'team1', 'team2']);
21
        }])->where('slug', $request->tournament)
22
            ->first();
23
        return view('fights.index', compact('tournament', 'grades'));
0 ignored issues
show
Bug Best Practice introduced by
The expression return view('fights.inde...tournament', 'grades')) returns the type Illuminate\Contracts\Vie...ry|Illuminate\View\View which is incompatible with the documented return type Illuminate\Http\Response.
Loading history...
24
25
    }
26
}
27