Completed
Push — master ( b1aac2...36d657 )
by Avtandil
09:00
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
 * 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 11
    public function boot(): void
20
    {
21 11
        $ips = config('lodash.debug.ips', []);
22 11
        $ip = app(Request::class)->getClientIp();
23 11
        if (!in_array($ip, $ips)) {
24 11
            return;
25
        }
26
27
        config(['app.debug' => true]);
28
    }
29
30 11
    public function register(): void
31
    {
32 11
    }
33
}
34