Completed
Push — master ( b56a59...34b930 )
by Avtandil
04:51
created

DebugServiceProvider::boot()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 8
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 0
crap 6
1
<?php
2
/*
3
 * This file is part of the Laravel Lodash package.
4
 *
5
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
declare(strict_types=1);
11
12
namespace Longman\LaravelLodash\Debug;
13
14
use Illuminate\Http\Request;
15
use Illuminate\Support\ServiceProvider;
16
17
class DebugServiceProvider extends ServiceProvider
18
{
19
    public function boot()
20
    {
21
        $ips = config('lodash.debug.ips');
22
        $ip = app(Request::class)->getClientIp();
23
        if (in_array($ip, $ips)) {
24
            config(['app.debug' => true]);
25
        }
26
    }
27
28
    public function register()
29
    {
30
    }
31
}
32