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.

Issues (472)

Controllers/ParticipantApi/AssignController.php (10 issues)

1
<?php
2
0 ignored issues
show
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
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
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...
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...
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...
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
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...
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...
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...
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
}