CacheProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 84.62%

Importance

Changes 0
Metric Value
wmc 3
eloc 10
dl 0
loc 34
ccs 11
cts 13
cp 0.8462
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A provides() 0 4 1
A register() 0 8 1
A boot() 0 5 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 207
    public function boot(): void
17
    {
18 207
        $this->publishes([
19 207
            __DIR__ . '/../../config/static-html-cache.php' => config_path('static-html-cache.php'),
20 207
        ], 'config');
21 207
    }
22
23
    /**
24
     * Register the application services.
25
     *
26
     * @return void
27
     */
28 207
    public function register(): void
29
    {
30 207
        $this->mergeConfigFrom(__DIR__ . '/../../config/static-html-cache.php', 'static-html-cache');
31
32 207
        $this->app->singleton(StaticRequestCache::class);
33
34 207
        $this->commands([
35 207
            ClearStaticCache::class,
36
        ]);
37 207
    }
38
39
    public function provides(): array
40
    {
41
        return [
42
            'static-html-cache'
43
        ];
44
    }
45
}
46