PhpInfoController   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 7
c 3
b 0
f 0
dl 0
loc 14
ccs 0
cts 7
cp 0
rs 10
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 12 4
1
<?php
2
3
namespace ThinKit\Http\Controllers;
4
5
use Illuminate\Http\Request;
6
use Illuminate\Routing\Controller;
7
8
class PhpInfoController extends Controller
9
{
10
    public function __invoke(Request $request)
11
    {
12
        if (app()->environment(config('thinkit.php.env_no_pass')) ||
0 ignored issues
show
introduced by
The method environment() does not exist on Illuminate\Container\Container. Are you sure you never get this type here, but always one of the subclasses? ( Ignorable by Annotation )

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

12
        if (app()->/** @scrutinizer ignore-call */ environment(config('thinkit.php.env_no_pass')) ||
Loading history...
13
            (config('thinkit.php.info_pass') &&
14
            ((string) $request->input('pass')) === config('thinkit.php.info_pass'))
15
        ) {
16
            phpinfo();
17
18
            return;
19
        }
20
21
        abort(404);
22
    }
23
}
24