TimegridioConciergeServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 91.67%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 46
ccs 11
cts 12
cp 0.9167
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 9 1
A register() 0 4 1
A registerConcierge() 0 6 1
1
<?php
2
3
namespace Timegridio\Concierge;
4
5
use Illuminate\Routing\Router;
6
use Illuminate\Support\ServiceProvider;
7
8
class TimegridioConciergeServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Indicates if loading of the provider is deferred.
12
     *
13
     * @var bool
14
     */
15
    protected $defer = false;
16
17
    /**
18
     * Perform post-registration booting of services.
19
     *
20
     * @return void
21
     */
22 152
    public function boot()
23
    {
24
        // use this if your package has views
25 152
        $this->loadViewsFrom(realpath(__DIR__.'/resources/views'), 'concierge');
26
27 152
        $this->publishes([
28 152
            __DIR__.'/../migrations/' => base_path('/database/migrations'),
29
        ]);
30 152
    }
31
32
    /**
33
     * Register any package services.
34
     *
35
     * @return void
36
     */
37 152
    public function register()
38
    {
39 152
        $this->registerConcierge();
40 152
    }
41
42
    /**
43
     * Register package.
44
     *
45
     * @return Concierge
46
     */
47
    private function registerConcierge()
48
    {
49 152
        $this->app->bind('concierge', function ($app) {
50
            return new Concierge($app);
0 ignored issues
show
Unused Code introduced by
The call to Concierge::__construct() has too many arguments starting with $app.

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...
51 152
        });
52 152
    }
53
}
54