IftttWebhookServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Arimolzer\IftttWebhook;
4
5
use Illuminate\Support\ServiceProvider;
6
7
/**
8
 * Class IftttWebhookServiceProvider
9
 * @package Arimolzer\IftttWebhook
10
 */
11
class IftttWebhookServiceProvider extends ServiceProvider
12
{
13
    /**
14
     * Bootstrap the application services.
15
     */
16
    public function boot()
17
    {
18
        if ($this->app->runningInConsole()) {
19
            $this->publishes([
20
                __DIR__.'/../config/config.php' => config_path('ifttt-webhook.php'),
21
            ], 'config');
22
        }
23
    }
24
25
    /**
26
     * Register the application services.
27
     */
28
    public function register()
29
    {
30
        // Automatically apply the package configuration
31
        $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'ifttt-webhook');
32
33
        // Register the main class to use with the facade
34
        $this->app->singleton('IftttWebhook', function () {
35
            return new IftttWebhookService;
36
        });
37
    }
38
}
39