Completed
Push — master ( c0e612...954278 )
by Jasper
04:23
created

CacheProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Swis\Laravel\StaticRequestCache\Provider;
4
5
use Illuminate\Support\ServiceProvider;
6
use Swis\Laravel\StaticRequestCache\Commands\ClearStaticCache;
7
use Swis\Laravel\StaticRequestCache\StaticRequestCache;
8
9
class CacheProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the application services.
13
     *
14
     * @return void
15
     */
16 154
    public function boot()
17
    {
18 154
        $this->publishes([
19 154
            __DIR__ . '/../../config/static-html-cache.php' => config_path('static-html-cache.php'),
20 154
        ], 'config');
21 154
    }
22
23
    /**
24
     * Register the application services.
25
     *
26
     * @return void
27
     */
28 154
    public function register()
29
    {
30 154
        $this->mergeConfigFrom(__DIR__ . '/../../config/static-html-cache.php', 'static-html-cache');
31
32 154
        $this->app->singleton(StaticRequestCache::class);
33
34 154
        $this->commands([
35 154
            ClearStaticCache::class,
36
        ]);
37 154
    }
38
39
    public function provides()
40
    {
41
        return [
42
            'static-html-cache'
43
        ];
44
    }
45
}
46