GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

UserRoleController::update()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
4
namespace BristolSU\ControlDB\Http\Controllers\User;
5
6
7
use BristolSU\ControlDB\Http\Controllers\Controller;
8
use BristolSU\ControlDB\Contracts\Models\Role;
9
use BristolSU\ControlDB\Contracts\Models\User;
10
11
/**
12
 * Handles the linking of users and roles
13
 */
0 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
Coding Style introduced by
Missing @author tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
14
class UserRoleController extends Controller
15
{
16
17
    /**
18
     * Get all roles that belong to a user
19
     *
20
     * @param User $user
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
21
     * @return \Illuminate\Pagination\LengthAwarePaginator
0 ignored issues
show
Coding Style introduced by
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
22
     */
23 1
    public function index(User $user)
24
    {
25 1
        return $this->paginate($user->roles());
26
    }
27
28
    /**
29
     * Add a role to a user
30
     *
31
     * @param User $user
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
32
     * @param Role $role
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
33
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
34 1
    public function update(User $user, Role $role)
35
    {
36 1
        $user->addRole($role);
37 1
    }
38
39
    /**
40
     * Remove a role from a user
41
     *
42
     * @param User $user
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
43
     * @param Role $role
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
44
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
45 1
    public function destroy(User $user, Role $role)
46
    {
47 1
        $user->removeRole($role);
48 1
    }
49
50
}
51