UsersController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A view() 0 14 2
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use App\Association;
6
use App\Series;
7
use App\User;
8
use Bouncer;
0 ignored issues
show
Bug introduced by
The type Bouncer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Illuminate\Http\Request;
10
11
class UsersController extends Controller
12
{
13
14
    public function view(User $user) {
15
        if (Bouncer::can('view-users')) {
16
            $associations = Association::where('user_id', $user->id)->get();
17
18
            $series = Series::where('user_id', $user->id)->get();
19
20
            return view('user', [
21
                'user' => $user,
22
                'associations' => $associations,
23
                'series' => $series,
24
            ]);
25
        }
26
        else {
27
            return view('denied');
28
        }
29
    }
30
31
}
32