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.

RoleUserController   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 4
c 0
b 0
f 0
dl 0
loc 34
ccs 7
cts 7
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A destroy() 0 3 1
A update() 0 3 1
A index() 0 3 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\Role;
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 link between a role and a user
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 RoleUserController extends Controller
15
{
16
17
    /**
18
     * Get all users belonging to a group
19
     * 
20
     * @param Role $role
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(Role $role)
24
    {
25 1
        return $this->paginate($role->users());
26
    }
27
28
    /**
29
     * Add a user to a role
30
     * 
31
     * @param Role $role
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
32
     * @param User $user
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(Role $role, User $user)
35
    {
36 1
        $role->addUser($user);
37 1
    }
38
39
    /**
40
     * Remove a user from a role
41
     * 
42
     * @param Role $role
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
43
     * @param User $user
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(Role $role, User $user)
46
    {
47 1
        $role->removeUser($user);
48 1
    }
49
50
}
51