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.

NotificationCollection   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A with() 0 7 1
A toArray() 0 4 1
1
<?php
2
3
namespace Coreproc\NovaNotificationFeed\Http\Resources;
4
5
use Illuminate\Http\Resources\Json\ResourceCollection;
0 ignored issues
show
Bug introduced by
The type Illuminate\Http\Resources\Json\ResourceCollection was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
class NotificationCollection extends ResourceCollection
8
{
9
    public $collects = NotificationResource::class;
10
11
    /**
12
     * Transform the resource collection into an array.
13
     *
14
     * @param  \Illuminate\Http\Request $request
0 ignored issues
show
Bug introduced by
The type Illuminate\Http\Request was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
     * @return array
16
     */
17
    public function toArray($request)
18
    {
19
        return [
20
            'data' => $this->collection,
21
        ];
22
    }
23
24
    public function with($request)
25
    {
26
        return [
27
            'meta' => [
28
                'unread_count' => 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

28
                'unread_count' => /** @scrutinizer ignore-call */ request()->user()->notifications()
Loading history...
29
                    ->whereNull('read_at')
30
                    ->count(),
31
            ],
32
        ];
33
    }
34
}
35