VueWorkflowMiddleware::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 2
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
1
<?php namespace Bantenprov\VueWorkflow\Http\Middleware;
2
3
use Closure;
4
5
/**
6
 * The VueWorkflowMiddleware class.
7
 *
8
 * @package Bantenprov\VueWorkflow
9
 * @author  bantenprov <[email protected]>
10
 */
11
class VueWorkflowMiddleware
12
{
13
14
15
    /**
16
     * Handle an incoming request.
17
     *
18
     * @param  \Illuminate\Http\Request  $request
19
     * @param  \Closure  $next
20
     * @return mixed
21
     */
22
    public function handle($request, Closure $next)
23
    {    
24
25
        //$return = response()->json(['guest' => true]);
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% 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...
26
27
        if(!\Auth::guest()){
28
            $return = response('',403);    
29
            
30
        }else{            
31
            $return = $next($request);
32
            
33
        }
34
35
        return $return;
36
    }
37
}
38