Completed
Push — master ( 163e54...d19868 )
by Elf
10:09
created

XgPusherServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 34
ccs 4
cts 4
cp 1
rs 10
wmc 2
lcom 1
cbo 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 8 1
A provides() 0 7 1
1
<?php
2
3
namespace App\Support\Providers;
4
5
use App\Support\Tencent\XgPusher;
6
use Illuminate\Support\ServiceProvider;
7
8
class XgPusherServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Indicates if loading of the provider is deferred.
12
     *
13
     * @var bool
14
     */
15
    protected $defer = true;
16
17
    /**
18
     * Register the service provider.
19
     */
20
    public function register()
21
    {
22 1
        $this->app->singleton(XgPusher::class, function () {
23
            return new XgPusher;
24 1
        });
25
26 1
        $this->app->alias(XgPusher::class, 'xgpusher');
27 1
    }
28
29
    /**
30
     * Get the services provided by the provider.
31
     *
32
     * @return array
33
     */
34
    public function provides()
35
    {
36
        return [
37
            XgPusher::class,
38
            'xgpusher',
39
        ];
40
    }
41
}
42