Passed
Push — master ( 879eee...4e94ae )
by du
04:43 queued 02:56
created

ServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 16
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace DucCnzj\Ip;
4
5
/**
6
 * Class ServiceProvider
7
 * @package DucCnzj\Ip
8
 */
9
class ServiceProvider extends \Illuminate\Support\ServiceProvider
10
{
11
    /**
12
     * @var bool
13
     */
14
    protected $defer = true;
15
16
    /**
17
     *
18
     * @author duc <[email protected]>
19
     */
20
    public function register()
21
    {
22
        $this->app->singleton(IpClient::class, function () {
23
            return new IpClient;
24
        });
25
26
        $this->app->alias(IpClient::class, 'ip');
27
    }
28
29
    /**
30
     * @return array
31
     *
32
     * @author duc <[email protected]>
33
     */
34
    public function provides()
35
    {
36
        return [IpClient::class, 'ip'];
37
    }
38
}
39