Completed
Pull Request — develop (#20)
by
unknown
02:43
created

ShareController::index()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 2
eloc 5
nc 2
nop 2
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use App\Hacktoberfest\GitHub\PullRequestChecker;
6
use App\User;
7
8
class ShareController extends Controller
9
{
10
    public function index(PullRequestChecker $checker, $github_username)
11
    {
12
        $user = User::where('github_username', '=', $github_username)->first();
13
14
        if (!$user) {
15
            return redirect('/');
16
        }
17
18
        $prs = $checker->getQualifiedPullRequests($user);
19
20
        return view('status', compact('user', 'prs'));
21
    }
22
}
23