ImageCacherServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 13 1
A boot() 0 4 1
1
<?php
2
3
namespace GNAHotelSolutions\ImageCacher\Adapters\Laravel;
4
5
use GNAHotelSolutions\ImageCacher\Cacher;
6
use Illuminate\Support\ServiceProvider;
7
8
class ImageCacherServiceProvider extends ServiceProvider
9
{
10
    public function register()
11
    {
12
        $this->mergeConfigFrom(__DIR__.'/config/image-cacher.php', 'image-cacher');
13
14
        $this->app->singleton(Cacher::class, function () {
15
            return new Cacher(
16
                config('image-cacher.cache_path'), 
17
                config('image-cacher.cache_root_path'), 
18
                config('image-cacher.images_root_path'),
19
                config('image-cacher.output_format')
20
            ); 
21
        });
22
    }
23
24
    public function boot()
25
    {
26
        $this->publishes([__DIR__.'/config/image-cacher.php' => config_path('image-cacher.php')]);
27
    }
28
}