Completed
Push — master ( 78b4bc...aee67f )
by Lorenzo
01:34
created

AffiliateNetworkServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
A register() 0 7 1
A provides() 0 6 1
1
<?php
2
3
namespace Padosoft\AffiliateNetwork;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class AffiliateNetworkServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Indicates if loading of the provider is deferred.
11
     *
12
     * @var bool
13
     */
14
    protected $defer = true;
15
16
    /**
17
     * Bootstrap the application events.
18
     *
19
     * @return void
20
     */
21
    public function boot()
22
    {
23
        $this->publishes([
24
            __DIR__ . '/config/config.php' => config_path('laravel-affiliate-network.php'),
25
        ], 'config');
26
    }
27
28
    /**
29
     * Register the service provider.
30
     *
31
     * @return void
32
     */
33
    public function register()
34
    {
35
        $this->app->share('alert', function (NetworkInterface $network) {
1 ignored issue
show
Bug introduced by
The method share() does not seem to exist on object<Illuminate\Contra...Foundation\Application>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
36
            return new NetworkManager($network);
37
        });
38
        $this->app->alias('networkmanager', NetworkManager::class);
39
    }
40
41
    /**
42
     * Get the services provided by the provider.
43
     *
44
     * @return string[]
45
     */
46
    public function provides()
47
    {
48
        return [
49
            'networkmanager',
50
        ];
51
    }
52
}
53