Completed
Push — master ( 9c3153...125483 )
by Avtandil
16s queued 14s
created

DebugServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 77.78%

Importance

Changes 0
Metric Value
dl 0
loc 17
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 register() 0 3 1
A boot() 0 10 2
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