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.

NotificationsController   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 9
c 1
b 0
f 0
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 17 3
1
<?php
2
3
namespace Coreproc\NovaNotificationFeed\Http\Controllers;
4
5
use Coreproc\NovaNotificationFeed\Http\Resources\NotificationCollection;
6
7
class NotificationsController
8
{
9
    public function index()
10
    {
11
        $notifications = request()->user()->notifications()
0 ignored issues
show
Bug introduced by
The function request was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

11
        $notifications = /** @scrutinizer ignore-call */ request()->user()->notifications()
Loading history...
12
            ->orderByDesc('created_at');
13
14
        $only = config('nova_notifications.only', []);
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

14
        $only = /** @scrutinizer ignore-call */ config('nova_notifications.only', []);
Loading history...
15
16
        if (! empty($only)) {
17
            $notifications->whereIn('type', $only);
18
        }
19
20
        if (request()->get('mark_as_read', false)) {
21
            // Mark notifications as read
22
            request()->user()->unreadNotifications->markAsRead();
23
        }
24
25
        return new NotificationCollection($notifications->paginate());
26
    }
27
}
28