Completed
Push — master ( 2384d0...cdc37f )
by Avtandil
03:50
created

DebugServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 87.5%

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 7
cts 8
cp 0.875
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 8 2
A register() 0 3 1
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
            config(['app.debug' => true]);
25
        }
26 11
    }
27
28 11
    public function register(): void
29
    {
30 11
    }
31
}
32