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.

ParticipantPageController::index()   A
last analyzed

Complexity

Conditions 2
Paths 3

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 8
c 1
b 0
f 0
nc 3
nop 1
dl 0
loc 13
ccs 0
cts 8
cp 0
crap 6
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;
4
5
use BristolSU\Module\AssignRoles\Support\PositionSettingRetrieval;
6
use BristolSU\Module\AssignRoles\Support\SettingRetrievalException;
7
use BristolSU\Support\Authentication\Contracts\Authentication;
8
9
class ParticipantPageController extends Controller
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class ParticipantPageController
Loading history...
10
{
11
12
    public function index(Authentication $authentication)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function index()
Loading history...
13
    {
14
        $this->authorize('view-page');
15
        
16
        try {
17
            $setting = app(PositionSettingRetrieval::class)->getSettings(
18
                $authentication->getGroup()
0 ignored issues
show
Bug introduced by
It seems like $authentication->getGroup() can also be of type null; however, parameter $group of BristolSU\Module\AssignR...etrieval::getSettings() does only seem to accept BristolSU\ControlDB\Contracts\Models\Group, maybe add an additional type check? ( Ignorable by Annotation )

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

18
                /** @scrutinizer ignore-type */ $authentication->getGroup()
Loading history...
19
            );
20
            $setting = app(PositionSettingRetrieval::class)->parse($setting);
21
        } catch (SettingRetrievalException $e) {
22
            return view('assign-roles::nosettings');
23
        }
24
        return view('assign-roles::participant')->with('positionSetting', $setting);
25
    }
26
    
27
}