bristol-su /
assign-roles
| 1 | <?php |
||||
| 2 | |||||
|
0 ignored issues
–
show
Coding Style
introduced
by
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
|
|||||
| 10 | { |
||||
| 11 | |||||
| 12 | public function index(Authentication $authentication) |
||||
|
0 ignored issues
–
show
|
|||||
| 13 | { |
||||
| 14 | $this->authorize('view-page'); |
||||
| 15 | |||||
| 16 | try { |
||||
| 17 | $setting = app(PositionSettingRetrieval::class)->getSettings( |
||||
| 18 | $authentication->getGroup() |
||||
|
0 ignored issues
–
show
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
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 | } |