LaravelIpMiddlewareServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 3
eloc 6
c 2
b 1
f 0
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 3 1
A boot() 0 6 2
1
<?php
2
3
namespace Orkhanahmadov\LaravelIpMiddleware;
4
5
use Illuminate\Support\ServiceProvider;
6
7
/**
8
 * @codeCoverageIgnore
9
 */
10
class LaravelIpMiddlewareServiceProvider extends ServiceProvider
11
{
12
    /**
13
     * Bootstrap the application services.
14
     */
15
    public function boot(): void
16
    {
17
        if ($this->app->runningInConsole()) {
18
            $this->publishes([
19
                __DIR__ . '/../config/config.php' => config_path('ip-middleware.php'),
20
            ], 'config');
21
        }
22
    }
23
24
    /**
25
     * Register the application services.
26
     */
27
    public function register(): void
28
    {
29
        $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'ip-middleware');
30
    }
31
}
32