CloudFrontServiceProvider::provides()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Meema\CloudFront\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
use Meema\CloudFront\CloudFrontManager;
7
use Meema\CloudFront\Facades\CloudFront;
8
9
class CloudFrontServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the application services.
13
     *
14
     * @throws \Illuminate\Contracts\Container\BindingResolutionException
15
     */
16
    public function boot()
17
    {
18
        if ($this->app->runningInConsole()) {
19
            $this->publishes([
20
                __DIR__.'/../../config/config.php' => config_path('cloudfront.php'),
21
            ], 'config');
22
        }
23
    }
24
25
    /**
26
     * Register the application services.
27
     */
28
    public function register()
29
    {
30
        $this->mergeConfigFrom(__DIR__.'/../../config/config.php', 'media-convert');
31
32
        $this->registerCloudFrontManager();
33
34
        $this->registerAliases();
35
    }
36
37
    /**
38
     * Registers the Text to speech manager.
39
     *
40
     * @return void
41
     */
42
    protected function registerCloudFrontManager()
43
    {
44
        $this->app->singleton('cloudfront', function ($app) {
45
            return new CloudFrontManager($app);
46
        });
47
    }
48
49
    /**
50
     * Register aliases.
51
     *
52
     * @return void
53
     */
54
    protected function registerAliases()
55
    {
56
        $this->app->alias(CloudFront::class, 'CloudFront');
57
    }
58
59
    /**
60
     * Get the services provided by the provider.
61
     *
62
     * @return array
63
     */
64
    public function provides(): array
65
    {
66
        return [
67
            'cloudfront',
68
        ];
69
    }
70
}
71