DebugServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 77.78%

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 7
cts 9
cp 0.7778
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 10 2
A register() 0 4 1
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