Completed
Pull Request — master (#10)
by
unknown
04:25
created

DebugServiceProvider::boot()   A

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
class DebugServiceProvider extends ServiceProvider
11
{
12 15
    public function boot(): void
13
    {
14 15
        $ips = config('lodash.debug.ips', []);
15 15
        $ip = app(Request::class)->getClientIp();
16 15
        if (! in_array($ip, $ips)) {
17 15
            return;
18
        }
19
20
        config(['app.debug' => true]);
21
    }
22
23 15
    public function register(): void
24
    {
25 15
    }
26
}
27