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

LumenServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
c 3
b 0
f 0
lcom 1
cbo 4
dl 0
loc 28
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A 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