LaravelSlackServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 41
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 18 1
A register() 0 9 1
1
<?php
2
3
/*
4
 * This file is part of the Laravel Slack package.
5
 *
6
 * (c) Gooodness Toluwanimi Kayode <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace GoodnessKay\LaravelSlack;
13
14
use Illuminate\Support\ServiceProvider;
15
16
class LaravelSlackServiceProvider extends ServiceProvider
17
{
18
    /**
19
     * Bootstrap the application services.
20
     *
21
     * @return void
22
     */
23
    public function boot()
24
    {
25
        $this->publishes([
26
            __DIR__.'/config/LaravelSlack.php' => config_path('LaravelSlack.php'),
27
        ], 'config');
28
29
        $this->publishes([
30
            __DIR__.'/views/slack' => resource_path('views/slack'),
31
        ]);
32
33
        $this->publishes([
34
            __DIR__.'/views/slack/slack-asset' => public_path('/slack-asset'),
35
        ], 'public');
36
37
        $this->publishes([
38
            __DIR__.'/controller/LaravelSlackController.php' => app_path('/Http/Controllers/LaravelSlackController.php'),
39
        ], 'app');
40
    }
41
42
    /**
43
     * Register the application services.
44
     *
45
     * @return void
46
     */
47
    public function register()
48
    {
49
50
        $this->loadViewsFrom(__DIR__.'/views/slack','slack');
51
        $this->mergeConfigFrom( __DIR__.'/config/LaravelSlack.php', 'LaravelSlack');
52
        $this->app->singleton(LaravelSlack::class, 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...
53
            return new LaravelSlack(config('laravelslack'));
0 ignored issues
show
Unused Code introduced by
The call to LaravelSlack::__construct() has too many arguments starting with config('laravelslack').

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
54
        });
55
    }
56
}
57