DebugServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2.0932

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 0
loc 10
ccs 5
cts 7
cp 0.7143
crap 2.0932
rs 9.9332
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Longman\LaravelLodash\Debug;
6
7
use Illuminate\Http\Request;
8
use Illuminate\Support\ServiceProvider;
9
10
use function in_array;
11
12
class DebugServiceProvider extends ServiceProvider
13
{
14 71
    public function boot(): void
15
    {
16 71
        $ips = config('lodash.debug.ips', []);
17 71
        $ip = app(Request::class)->getClientIp();
18 71
        if (! in_array($ip, $ips)) {
19 71
            return;
20
        }
21
22
        config(['app.debug' => true]);
23
    }
24
25 71
    public function register(): void
26
    {
27
        //
28 71
    }
29
}
30