1 | <?php |
||
10 | class MakeFactoryCommand extends GeneratorCommand |
||
11 | { |
||
12 | use ModuleCommandTrait; |
||
13 | |||
14 | /** |
||
15 | * The name of argument name. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $argumentName = 'name'; |
||
20 | |||
21 | /** |
||
22 | * The console command name. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $name = 'module:make-factory'; |
||
27 | |||
28 | /** |
||
29 | * The console command description. |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $description = 'Create a new model factory for the specified module.'; |
||
34 | |||
35 | /** |
||
36 | * Get the console command arguments. |
||
37 | * |
||
38 | * @return array |
||
39 | */ |
||
40 | 59 | protected function getArguments() |
|
47 | |||
48 | /** |
||
49 | * @return mixed |
||
50 | */ |
||
51 | 2 | protected function getTemplateContents() |
|
57 | |||
58 | /** |
||
59 | * @return mixed |
||
60 | */ |
||
61 | 2 | protected function getDestinationFilePath() |
|
69 | |||
70 | /** |
||
71 | * @return string |
||
72 | */ |
||
73 | 2 | private function getFileName() |
|
77 | } |
||
78 |
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.