WebhookServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 18 3
A register() 0 6 1
1
<?php
2
3
namespace Bencoderus\Webhook;
4
5
use Bencoderus\Webhook\Console\InstallCommand;
6
use Bencoderus\Webhook\Console\MakeWebhookCommand;
7
use Illuminate\Support\ServiceProvider;
8
9
class WebhookServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the application services.
13
     */
14
    public function boot()
15
    {
16
        if ($this->app->runningInConsole()) {
17
            $this->publishes([
18
                __DIR__ . '/../config/config.php' => config_path('webhook.php'),
19
            ], 'config');
20
21
            if (! class_exists('CreateWebhookLogsTable')) {
22
                $this->publishes([
23
                    __DIR__ . '/../database/migrations/create_webhook_logs_table.php.stub' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_webhook_logs_table.php'),
24
                    // you can add any number of migrations here
25
                ], 'migrations');
26
            }
27
28
            // Registering package commands.
29
            $this->commands([MakeWebhookCommand::class, InstallCommand::class]);
30
        }
31
    }
32
33
    /**
34
     * Register the application services.
35
     */
36
    public function register()
37
    {
38
        // Automatically apply the package configuration
39
        $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'webhook');
40
41
    }
42
}
43