EmailLogServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 53
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 34 2
A register() 0 9 1
1
<?php
2
3
namespace Tompec\EmailLog;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class EmailLogServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     */
12 11
    public function boot()
13
    {
14
        /*
15
         * Optional methods to load your package assets
16
         */
17
        // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'email-log');
18
        // $this->loadViewsFrom(__DIR__.'/../resources/views', 'email-log');
19 11
        $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
20 11
        $this->loadRoutesFrom(__DIR__.'/routes.php');
21
22 11
        if ($this->app->runningInConsole()) {
23 11
            $this->publishes([
24 11
                __DIR__.'/../config/config.php' => config_path('email-log.php'),
25 11
            ], 'config');
26
27
            // Publishing the views.
28
            /*$this->publishes([
29
                __DIR__.'/../resources/views' => resource_path('views/vendor/laravel-email-log'),
30
            ], 'views');*/
31
32
            // Publishing assets.
33
            /*$this->publishes([
34
                __DIR__.'/../resources/assets' => public_path('vendor/laravel-email-log'),
35
            ], 'assets');*/
36
37
            // Publishing the translation files.
38
            /*$this->publishes([
39
                __DIR__.'/../resources/lang' => resource_path('lang/vendor/laravel-email-log'),
40
            ], 'lang');*/
41
42
            // Registering package commands.
43
            // $this->commands([]);
44
        }
45 11
    }
46
47
    /**
48
     * Register the application services.
49
     */
50 11
    public function register()
51
    {
52
        // Automatically apply the package configuration
53 11
        $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'email-log');
54
55 11
        $this->app->register(EmailLogEventServiceProvider::class);
56
57 11
        $this->app['router']->aliasMiddleware('mailgun', MailgunWebhook::class);
58 11
    }
59
}
60