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

XgPusherServiceProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 8
ccs 4
cts 4
cp 1
crap 1
rs 9.4285
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