Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php namespace App\Modules\Core; |
||
18 | public function __call($name, $arguments) |
||
19 | { |
||
20 | foreach (\Module::all() as $module) { |
||
21 | $nameSpace = 'App\\Modules\\' . $module['basename'] ; |
||
22 | $model = ucfirst(\Str::singular($name)); |
||
23 | $class = $nameSpace . '\\Repositories\\' . $model . 'Repository'; |
||
24 | $decoratedClass = $class . '\\Decorated'; |
||
|
|||
25 | |||
26 | if (class_exists($class)) { |
||
27 | $classObj = \App::make($class); |
||
28 | \App::singleton($class, function ($app) use ($classObj) { |
||
29 | return new CachingDecorator($classObj, $app['cache.store']); |
||
30 | }); |
||
31 | |||
32 | return \App::make($class); |
||
33 | } |
||
34 | } |
||
35 | } |
||
36 | } |
||
37 |
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.