HomeController::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 2
eloc 2
nc 2
nop 0
crap 2
1
<?php
2
namespace agoalofalife\postman\Http\Controllers;
3
4
use Illuminate\View\View;
5
6
class HomeController
7
{
8 2
    public function __construct()
9
    {
10 2
        if (class_exists(config('postman.middleware'))) {
11 1
            $this->middleware(config('postman.middleware'));
0 ignored issues
show
Bug introduced by
The method middleware() does not exist on agoalofalife\postman\Htt...trollers\HomeController. ( Ignorable by Annotation )

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

11
            $this->/** @scrutinizer ignore-call */ 
12
                   middleware(config('postman.middleware'));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
12
        }
13 1
    }
14
15 1
    public function index() : View
16
    {
17 1
        return view('postman::app');
18
    }
19
}