Completed
Push — master ( d3edc0...9b98b0 )
by Mahmoud
07:44
created

MiddlewareServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 38
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 4 1
1
<?php
2
3
namespace App\Containers\Debugger\Providers;
4
5
use App\Containers\Debugger\Middlewares\RequestsMonitorMiddleware;
6
use App\Containers\Debugger\Traits\DebuggerTrait;
7
use App\Port\Middleware\Providers\PortMiddlewareServiceProvider;
8
9
/**
10
 * Class MiddlewareServiceProvider.
11
 *
12
 * The Main Service Provider of this container, it will be automatically registered in the framework.
13
 *
14
 * @author  Mahmoud Zalt <[email protected]>
15
 */
16
class MiddlewareServiceProvider extends PortMiddlewareServiceProvider
17
{
18
    use DebuggerTrait;
19
20
    protected $middleware = [
21
22
    ];
23
24
    protected $middlewareGroups = [
25
        'web' => [
26
27
        ],
28
        'api' => [
29
            // Hello API Requests Monitor
30
            RequestsMonitorMiddleware::class,
31
        ],
32
    ];
33
34
    protected $routeMiddleware = [
35
36
    ];
37
38
    /**
39
     * Perform post-registration booting of services.
40
     */
41
    public function boot()
42
    {
43
        $this->loadContainersInternalMiddlewares();
44
    }
45
46
    /**
47
     * Register anything in the container.
48
     */
49
    public function register()
50
    {
51
        $this->runQueryDebugger(true, true);
52
    }
53
}
54