SilentSpamServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 34 2
A register() 0 12 2
1
<?php
2
3
namespace Breadthe\SilentSpam;
4
5
use Illuminate\Support\Facades\File;
6
use Illuminate\Support\ServiceProvider;
7
8
class SilentSpamServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     */
13
    public function boot()
14
    {
15
        /*
16
         * Optional methods to load your package assets
17
         */
18
        // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'laravel-silent-spam-filter');
19
        // $this->loadViewsFrom(__DIR__.'/../resources/views', 'laravel-silent-spam-filter');
20
        // $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
21
        // $this->loadRoutesFrom(__DIR__.'/routes.php');
22
23
        $this->publishes([
24
            __DIR__.'/../config/silentspam.php' => config_path('silentspam.php'),
25
        ], 'silentspam-config');
26
27
        // Publishing the views.
28
        /*$this->publishes([
29
            __DIR__.'/../resources/views' => resource_path('views/vendor/laravel-silent-spam-filter'),
30
        ], 'views');*/
31
32
        // Publishing assets.
33
        /*$this->publishes([
34
            __DIR__.'/../resources/assets' => public_path('vendor/laravel-silent-spam-filter'),
35
        ], 'assets');*/
36
37
        // Publishing the translation files.
38
        /*$this->publishes([
39
            __DIR__.'/../resources/lang' => resource_path('lang/vendor/laravel-silent-spam-filter'),
40
        ], 'lang');*/
41
42
        if ($this->app->runningInConsole()) {
43
            // Registering package commands.
44
            // $this->commands([]);
45
        }
46
    }
47
48
    /**
49
     * Register the application services.
50
     */
51
    public function register()
52
    {
53
        // Automatically apply the package configuration
54
        if (File::exists(__DIR__.'/../config/silentspam.php')) {
55
            $this->mergeConfigFrom(__DIR__.'/../config/silentspam.php', 'silentspam');
56
        }
57
58
        // Register the main class to use with the facade
59
        $this->app->singleton('silent-spam', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
60
            return new SilentSpam();
61
        });
62
    }
63
}
64