DashboardCardRequest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
c 2
b 0
f 0
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A availableCards() 0 11 2
1
<?php
2
3
namespace AlexBowers\MultipleDashboard\Http\Requests;
4
5
use AlexBowers\MultipleDashboard\DashboardNova;
6
use Laravel\Nova\Http\Requests\NovaRequest;
0 ignored issues
show
Bug introduced by
The type Laravel\Nova\Http\Requests\NovaRequest 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...
7
8
class DashboardCardRequest extends NovaRequest
9
{
10
    /**
11
     * Get all of the possible cards for the request.
12
     *
13
     * @return \Illuminate\Support\Collection
0 ignored issues
show
Bug introduced by
The type Illuminate\Support\Collection 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...
14
     */
15
    public function availableCards($dashboard)
16
    {
17
        if ($dashboard == 'main') {
18
            return collect(DashboardNova::$default_dashboard_cards)
0 ignored issues
show
Bug introduced by
The function collect 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

18
            return /** @scrutinizer ignore-call */ collect(DashboardNova::$default_dashboard_cards)
Loading history...
19
                    ->unique()
20
                    ->filter
21
                    ->authorize($this)
22
                    ->values();
23
        }
24
25
        return DashboardNova::availableDashboardCardsForDashboard($dashboard, $this);
26
    }
27
}
28