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.

AssignController::destroy()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 6
dl 0
loc 7
ccs 5
cts 5
cp 1
crap 1
rs 10
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace BristolSU\Module\AssignRoles\Http\Controllers\ParticipantApi;
4
5
use BristolSU\ControlDB\Contracts\Models\Role;
6
use BristolSU\ControlDB\Contracts\Models\User;
7
use BristolSU\ControlDB\Contracts\Repositories\Pivots\UserRole;
8
use BristolSU\Module\AssignRoles\Events\UserAssigned;
9
use BristolSU\Module\AssignRoles\Http\Controllers\Controller;
10
use BristolSU\Module\AssignRoles\Http\Requests\ParticipantApi\AssignController\DestroyRequest;
11
use BristolSU\Module\AssignRoles\Http\Requests\ParticipantApi\AssignController\UpdateRequest;
12
use BristolSU\Support\Activity\Activity;
13
use BristolSU\Support\Authentication\Contracts\Authentication;
14
use BristolSU\Support\ModuleInstance\ModuleInstance;
15
16
class AssignController extends Controller
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class AssignController
Loading history...
17
{
18
19 3
    public function update(Activity $activity, ModuleInstance $moduleInstance, int $roleId, int $userId, UpdateRequest $request, UserRole $userRole)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

19
    public function update(Activity $activity, ModuleInstance $moduleInstance, int $roleId, int $userId, /** @scrutinizer ignore-unused */ UpdateRequest $request, UserRole $userRole)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $activity is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

19
    public function update(/** @scrutinizer ignore-unused */ Activity $activity, ModuleInstance $moduleInstance, int $roleId, int $userId, UpdateRequest $request, UserRole $userRole)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $moduleInstance is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

19
    public function update(Activity $activity, /** @scrutinizer ignore-unused */ ModuleInstance $moduleInstance, int $roleId, int $userId, UpdateRequest $request, UserRole $userRole)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Coding Style introduced by
Missing doc comment for function update()
Loading history...
20
    {
21 3
        $this->authorize('assign');
22
        
23 2
        $userRole->addUserToRole(
24 2
            $user = app(\BristolSU\ControlDB\Contracts\Repositories\User::class)->getById($userId),
25 2
            $role = app(\BristolSU\ControlDB\Contracts\Repositories\Role::class)->getById($roleId)
26
        );
27
        
28 2
        event(new UserAssigned($user, $role));
29
        
30 2
    }
31
32 3
    public function destroy(Activity $activity, ModuleInstance $moduleInstance, int $roleId, int $userId, DestroyRequest $request, UserRole $userRole)
0 ignored issues
show
Unused Code introduced by
The parameter $moduleInstance is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

32
    public function destroy(Activity $activity, /** @scrutinizer ignore-unused */ ModuleInstance $moduleInstance, int $roleId, int $userId, DestroyRequest $request, UserRole $userRole)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $activity is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

32
    public function destroy(/** @scrutinizer ignore-unused */ Activity $activity, ModuleInstance $moduleInstance, int $roleId, int $userId, DestroyRequest $request, UserRole $userRole)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

32
    public function destroy(Activity $activity, ModuleInstance $moduleInstance, int $roleId, int $userId, /** @scrutinizer ignore-unused */ DestroyRequest $request, UserRole $userRole)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Coding Style introduced by
Missing doc comment for function destroy()
Loading history...
33
    {
34 3
        $this->authorize('unassign');
35
        
36 2
        $userRole->removeUserFromRole(
37 2
            app(\BristolSU\ControlDB\Contracts\Repositories\User::class)->getById($userId),
38 2
            app(\BristolSU\ControlDB\Contracts\Repositories\Role::class)->getById($roleId)
39
        );
40 2
    }
41
    
42
    
43
    
44
}