| Conditions | 8 | 
| Paths | 5 | 
| Total Lines | 32 | 
| Code Lines | 14 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 13 | 
| CRAP Score | 8.1515 | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php  | 
            ||
| 23 | 700 | public function handle($request, Closure $next)  | 
            |
| 24 |     { | 
            ||
| 25 | 700 |         if(config('logging.channels.daily.level') === 'debug') | 
            |
| 26 |         { | 
            ||
| 27 | 700 | $user = isset(Auth::user()->user_id) ? Auth::user()->full_name : \Request::ip();  | 
            |
| 28 | 700 | $requestData = $request->request->all();  | 
            |
| 29 | |||
| 30 | 700 |             Log::debug('Route '.Route::currentRouteName().' visited by '.$user); | 
            |
| 31 | |||
| 32 | 700 | if($requestData)  | 
            |
| 
                                                                                                    
                        
                         | 
                |||
| 33 |             { | 
            ||
| 34 | 330 | foreach($this->redact as $i)  | 
            |
| 35 |                 { | 
            ||
| 36 | 330 | if(Arr::exists($requestData, $i))  | 
            |
| 37 |                     { | 
            ||
| 38 | 30 | $requestData[$i] = '[REDACTED]';  | 
            |
| 39 | }  | 
            ||
| 40 | }  | 
            ||
| 41 | 330 | foreach($this->ignore as $i)  | 
            |
| 42 |                 { | 
            ||
| 43 | 330 | if(Arr::exists($requestData, $i))  | 
            |
| 44 |                     { | 
            ||
| 45 | unset($requestData[$i]);  | 
            ||
| 46 | }  | 
            ||
| 47 | }  | 
            ||
| 48 | 330 |                 Log::debug('Submitted Data ', $requestData); | 
            |
| 49 | }  | 
            ||
| 50 | |||
| 51 | 700 | return $next($request);  | 
            |
| 52 | }  | 
            ||
| 53 | |||
| 54 | return $next($request);  | 
            ||
| 55 | }  | 
            ||
| 57 | 
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.