Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function handle($request, Closure $next) { |
||
20 | |||
21 | // If the URL of the request is in exceptions. |
||
22 | if ($this->shouldIgnore($request)) { |
||
23 | return $next($request); |
||
24 | } |
||
25 | |||
26 | $app = app(); |
||
|
|||
27 | |||
28 | $currentLocale = app('laravellocalization')->getCurrentLocale(); |
||
29 | $viewPath = resource_path('views/' . $currentLocale); |
||
30 | |||
31 | // Add current locale-code to view-paths |
||
32 | View::addLocation($viewPath); |
||
33 | |||
34 | return $next($request); |
||
35 | } |
||
36 | |||
38 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.