Completed
Push — master ( 0f3a77...fc3715 )
by Elf
02:40
created

AgentServiceProvider::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
namespace ElfSundae\Agent;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class AgentServiceProvider 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
     * Register the service provider.
18
     *
19
     * @return void
20
     */
21
    public function register()
22
    {
23
        $this->app->singleton('agent', function ($app) {
24
            return new Agent($app['request']->server());
25
        });
26
27
        $this->app->alias('agent', Agent::class);
28
    }
29
30
    /**
31
     * Get the services provided by the provider.
32
     *
33
     * @return array
34
     */
35
    public function provides()
36
    {
37
        return ['agent', Agent::class];
38
    }
39
}
40