SilentSpamServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 34

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 34
rs 9.376
c 0
b 0
f 0
cc 2
nc 2
nop 0
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