VarnishServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace DeltaBlue\Varnish;
4
5
use Illuminate\Support\ServiceProvider;
6
use DeltaBlue\Varnish\Commands\FlushVarnishCache;
7
8
class VarnishServiceProvider extends ServiceProvider
9
{
10
    public function boot()
11
    {
12
        if ($this->app->runningInConsole()) {
13
            $configPath = __DIR__.'/../config/varnish.php';
14
15
            $publishPath = base_path('config/varnish.php');
16
17
            $this->publishes([$configPath => $publishPath], 'config');
18
        }
19
    }
20
21
    public function register()
22
    {
23
        $this->mergeConfigFrom(__DIR__.'/../config/varnish.php', 'varnish');
24
25
        $this->app->bind('command.varnish:flush', FlushVarnishCache::class);
26
27
        $this->commands([
28
            'command.varnish:flush',
29
        ]);
30
    }
31
}
32