provides()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace ag84ark\AwsSesBounceComplaintHandler;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class AwsSesBounceComplaintHandlerServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Perform post-registration booting of services.
11
     */
12 13
    public function boot(): void
13
    {
14
        // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'ag84ark');
15
        // $this->loadViewsFrom(__DIR__.'/../resources/views', 'ag84ark');
16 13
        $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
17 13
        $this->loadRoutesFrom(__DIR__.'/../routes/routes.php');
18
19
        // Publishing is only necessary when using the CLI.
20 13
        if ($this->app->runningInConsole()) {
21 13
            $this->bootForConsole();
22
        }
23 13
    }
24
25
    /**
26
     * Register any package services.
27
     *
28
     * @return void
29
     */
30 13
    public function register()
31
    {
32 13
        $this->mergeConfigFrom(__DIR__.'/../config/aws-ses-bounce-complaint-handler.php', 'aws-ses-bounce-complaint-handler');
33
34
        // Register the service the package provides.
35
        $this->app->singleton('aws-ses-bounce-complaint-handler', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

35
        $this->app->singleton('aws-ses-bounce-complaint-handler', function (/** @scrutinizer ignore-unused */ $app) {

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

Loading history...
36 4
            return new AwsSesBounceComplaintHandler();
37 13
        });
38 13
    }
39
40
    /**
41
     * Get the services provided by the provider.
42
     */
43
    public function provides(): array
44
    {
45
        return ['aws-ses-bounce-complaint-handler'];
46
    }
47
48
    /**
49
     * Console-specific booting.
50
     */
51 13
    protected function bootForConsole(): void
52
    {
53
        // Publishing the configuration file.
54 13
        $this->publishes([
55 13
            __DIR__.'/../config/aws-ses-bounce-complaint-handler.php' => config_path('aws-ses-bounce-complaint-handler.php'),
56 13
        ], 'aws-ses-bounce-complaint-handler.config');
57
58 13
        if (! class_exists('CreateWrongEmailsTable')) {
59
            $this->publishes([
60
                __DIR__.'/../database/migrations/create_wrong_emails_table.php.stub' => database_path('migrations/'.date('Y_m_d_His', time()).'_create_wrong_emails_table.php'),
61
            ], 'migrations');
62
        }
63
64
        // Publishing the views.
65
        /*$this->publishes([
66
            __DIR__.'/../resources/views' => base_path('resources/views/vendor/ag84ark'),
67
        ], 'aws-ses-bounce-complaint-handler.views');*/
68
69
        // Publishing assets.
70
        /*$this->publishes([
71
            __DIR__.'/../resources/assets' => public_path('vendor/ag84ark'),
72
        ], 'aws-ses-bounce-complaint-handler.views');*/
73
74
        // Publishing the translation files.
75
        /*$this->publishes([
76
            __DIR__.'/../resources/lang' => resource_path('lang/vendor/ag84ark'),
77
        ], 'aws-ses-bounce-complaint-handler.views');*/
78
79
        // Register)ing package commands.
80
        //        // $this->commands([];
81 13
    }
82
}
83