ListController::__invoke()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 10
ccs 5
cts 5
cp 1
rs 10
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace UserAdmin\Http\Controllers;
4
5
use UserAdmin\Facades\UserAdmin;
6
use UserAdmin\Http\Requests\ListRequest;
7
use UserAdmin\IndexPage\IndexPage;
8
9
class ListController
10
{
11 3
    public function __invoke(ListRequest $request)
12
    {
13
        /** @var IndexPage $page */
14 3
        $page = UserAdmin::indexPage()->resolve($request->input(config('user-adminboard.pagename_key')));
0 ignored issues
show
Bug introduced by
The method indexPage() does not exist on UserAdmin\Facades\UserAdmin. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

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

14
        $page = UserAdmin::/** @scrutinizer ignore-call */ indexPage()->resolve($request->input(config('user-adminboard.pagename_key')));
Loading history...
15
16 3
        if (!$page->authorised($request)) {
17 1
            abort(403);
18
        }
19
20 2
        return $page->process($request);
21
    }
22
}
23