DebugServiceProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
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