Completed
Push — master ( 063bdc...995895 )
by Mahmoud
04:00
created

Kernel::routeMiddlewares()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 24
rs 8.9713
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
3
namespace App\Port\Middleware\Middlewares;
4
5
/**
6
 * Class Kernel
7
 *
8
 * @author  Mahmoud Zalt  <[email protected]>
9
 */
10
class Kernel
11
{
12
13
    /**
14
     * The application's global HTTP middleware stack.
15
     *
16
     * @return  array
17
     */
18
    public function applicationMiddlewares()
19
    {
20
        return [
21
            // Laravel default middleware's
22
            \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
23
            \App\Port\Middleware\Middlewares\Http\EncryptCookies::class,
24
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
25
26
            // removing some of the Laravel's default middleware's
27
            //            \Illuminate\Session\Middleware\StartSession::class,
28
            //            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
29
            //            \App\Port\Middleware\Middlewares\Http\VerifyCsrfToken::class,
30
31
            // CORS Package middleware
32
            \Barryvdh\Cors\HandleCors::class,
33
            // Hello API Localization middleware
34
            \App\Port\Middleware\Middlewares\Http\Localization::class,
35
        ];
36
    }
37
38
    /**
39
     * The application's route middleware.
40
     *
41
     * @return  array
42
     */
43
    public function routeMiddlewares()
44
    {
45
        return [
46
            // removing the Laravel's default route middleware's
47
            //            'auth' => \App\Port\Middleware\Middlewares\Http\Authenticate::class,
0 ignored issues
show
Unused Code Comprehensibility introduced by
45% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
48
            //            'auth.basic' => \App\Port\Middleware\Middlewares\Http\AuthenticateWithBasicAuth::class,
0 ignored issues
show
Unused Code Comprehensibility introduced by
45% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
49
            //            'guest' => \App\Port\Middleware\Middlewares\Http\RedirectIfAuthenticated::class,
0 ignored issues
show
Unused Code Comprehensibility introduced by
45% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
50
51
            // JWT Package middleware's
52
            'jwt.auth'    => \Tymon\JWTAuth\Middleware\GetUserFromToken::class,
53
            'jwt.refresh' => \Tymon\JWTAuth\Middleware\RefreshToken::class,
54
55
            // Entrust Package middleware's
56
            'role'        => \Zizaco\Entrust\Middleware\EntrustRole::class,
57
            'permission'  => \Zizaco\Entrust\Middleware\EntrustPermission::class,
58
            'ability'     => \Zizaco\Entrust\Middleware\EntrustAbility::class,
59
60
            // Hello API Visitor User Authentication middleware
61
            'visitor.auth'  => \App\Containers\APIAuthentication\Middlewares\VisitorsAuthentication::class,
62
63
            // ...
64
        ];
65
66
    }
67
68
}
69