Completed
Push — master ( 69b403...a82f99 )
by Colin
02:59 queued 12s
created

LumenServiceProvider::boot()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 15
Code Lines 7

Duplication

Lines 7
Ratio 46.67 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 7
loc 15
rs 9.4285
cc 3
eloc 7
nc 2
nop 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A LumenServiceProvider::register() 0 12 1
1
<?php
2
3
namespace Cviebrock\LaravelElasticsearch;
4
5
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
6
7
8
/**
9
 * Class ServiceProvider
10
 *
11
 * @package Cviebrock\LaravelElasticsearch
12
 */
13
class LumenServiceProvider extends BaseServiceProvider
14
{
15
16
    /**
17
     * Indicates if loading of the provider is deferred.
18
     *
19
     * @var bool
20
     */
21
    protected $defer = false;
22
23
    /**
24
     * Register the service provider.
25
     *
26
     * @return void
27
     */
28
    public function register()
29
    {
30
        $app = $this->app;
31
32
        $app->singleton('elasticsearch.factory', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
33
            return new Factory();
34
        });
35
36
        $app->singleton('elasticsearch', function ($app) {
37
            return new LumenManager($app, $app['elasticsearch.factory']);
38
        });
39
    }
40
}
41