Completed
Push — develop ( 0a4bcc...0131cc )
by Kirill
25:10
created

GitterMiddlewaresServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 14 1
1
<?php
2
/**
3
 * This file is part of GitterBot package.
4
 *
5
 * @author Serafim <[email protected]>
6
 * @date 27.01.2016 17:49
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace App\Providers;
12
13
14
use Illuminate\Support\ServiceProvider;
15
use App\Gitter\Extensions\MiddlewareBuilder;
16
use App\Gitter\Middlewares\KarmaCounterMiddleware;
17
use App\Gitter\Middlewares\GoogleSearchMiddleware;
18
use App\Gitter\Middlewares\EloquentQueryBuilderMiddleware;
19
20
21
/**
22
 * Class GitterMiddlewaresServiceProvider
23
 * @package App\Providers
24
 */
25
class GitterMiddlewaresServiceProvider extends ServiceProvider
26
{
27
    public function boot()
28
    {
29
30
    }
31
32
    public function register()
33
    {
34
        $this->app['gitter.middlewares'] = $this->app->share(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...
35
            $builder = app(MiddlewareBuilder::class);
36
37
            $builder->registerMiddleware(GoogleSearchMiddleware::class);
38
            $builder->registerMiddleware(KarmaCounterMiddleware::class);
39
            $builder->registerMiddleware(EloquentQueryBuilderMiddleware::class);
40
41
            return $builder;
42
        });
43
44
        $this->app->instance(MiddlewareBuilder::class, $this->app->make('gitter.middlewares'));
45
    }
46
}
47