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.

BindRoleRepository::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 11
ccs 6
cts 6
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\Middleware;
4
5
use BristolSU\ControlDB\Contracts\Repositories\Pivots\UserRole;
6
use BristolSU\ControlDB\Contracts\Repositories\Role;
7
use BristolSU\Module\AssignRoles\Support\LogicRoleRepository;
8
use BristolSU\Module\AssignRoles\Support\LogicUserRoleRepository;
9
use BristolSU\Support\Logic\Contracts\LogicTester;
10
use Illuminate\Http\Request;
11
12
class BindRoleRepository
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class BindRoleRepository
Loading history...
13
{
14
15
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
16
     * @var LogicTester
17
     */
18
    private $logicTester;
0 ignored issues
show
Coding Style introduced by
Private member variable "logicTester" must be prefixed with an underscore
Loading history...
19
20 40
    public function __construct(LogicTester $logicTester)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function __construct()
Loading history...
21
    {
22 40
        $this->logicTester = $logicTester;
23 40
    }
24
25 40
    public function handle(Request $request, \Closure $next)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function handle()
Loading history...
26
    {
27
        app()->extend(Role::class, function($roleRepository, $app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app 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

27
        app()->extend(Role::class, function($roleRepository, /** @scrutinizer ignore-unused */ $app) {

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
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
28 40
            return new LogicRoleRepository($roleRepository, $this->logicTester);
29 40
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
30
31
        app()->extend(UserRole::class, function($userRole, $app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app 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

31
        app()->extend(UserRole::class, function($userRole, /** @scrutinizer ignore-unused */ $app) {

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
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
32 25
            return new LogicUserRoleRepository($userRole, $this->logicTester);
33 40
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
34
        
35 40
        return $next($request);
36
    }
37
    
38
}