AssetCdnServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
eloc 14
c 2
b 0
f 1
dl 0
loc 35
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 16 1
A boot() 0 5 1
1
<?php
2
3
namespace Arubacao\AssetCdn;
4
5
use Arubacao\AssetCdn\Commands\EmptyCommand;
6
use Arubacao\AssetCdn\Commands\PushCommand;
7
use Arubacao\AssetCdn\Commands\SyncCommand;
8
use Illuminate\Support\ServiceProvider;
9
10
class AssetCdnServiceProvider extends ServiceProvider
11
{
12
    /**
13
     * Bootstrap the application events.
14
     *
15
     * @return void
16
     */
17
    public function boot()
18
    {
19
        $this->publishes([
20
            __DIR__.'/../config/asset-cdn.php' => config_path('asset-cdn.php'),
21
        ], 'config');
22
    }
23
24
    /**
25
     * Register the service provider.
26
     *
27
     * @return void
28
     */
29
    public function register()
30
    {
31
        $this->mergeConfigFrom(__DIR__.'/../config/asset-cdn.php', 'asset-cdn');
32
33
        $this->app->singleton(Finder::class, function ($app) {
34
            return new Finder(new Config($app->make('config'), $app->make('path.public')));
35
        });
36
37
        $this->app->bind('command.asset-cdn:push', PushCommand::class);
38
        $this->app->bind('command.asset-cdn:sync', SyncCommand::class);
39
        $this->app->bind('command.asset-cdn:empty', EmptyCommand::class);
40
41
        $this->commands([
42
            'command.asset-cdn:push',
43
            'command.asset-cdn:sync',
44
            'command.asset-cdn:empty',
45
        ]);
46
    }
47
}
48