Completed
Push — master ( 482a48...3ca353 )
by Ariel
02:54
created

TimegridioConciergeServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 3
c 4
b 0
f 0
lcom 1
cbo 3
dl 0
loc 46
rs 10

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
    public function boot()
23
    {
24
        // use this if your package has views
25
        $this->loadViewsFrom(realpath(__DIR__.'/resources/views'), 'concierge');
26
27
        $this->publishes([
28
            __DIR__.'/../migrations/' => base_path('/database/migrations'),
29
        ]);
30
    }
31
32
    /**
33
     * Register any package services.
34
     *
35
     * @return void
36
     */
37
    public function register()
38
    {
39
        $this->registerConcierge();
40
    }
41
42
    /**
43
     * Register package.
44
     *
45
     * @return Concierge
46
     */
47
    private function registerConcierge()
48
    {
49
        $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
        });
52
    }
53
}
54