1 | <?php |
||
10 | class RequestMakeCommand extends GeneratorCommand |
||
11 | { |
||
12 | /** |
||
13 | * The console command name. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $name = 'cray:request'; |
||
18 | |||
19 | /** |
||
20 | * The console command description. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $description = 'Create a new form request class'; |
||
25 | |||
26 | /** |
||
27 | * The type of class being generated. |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $type = 'Request'; |
||
32 | |||
33 | /** |
||
34 | * Get the stub file for the generator. |
||
35 | * |
||
36 | * @return string |
||
37 | */ |
||
38 | protected function getStub() |
||
46 | |||
47 | protected function buildClass($name) |
||
61 | |||
62 | /** |
||
63 | * Get the default namespace for the class. |
||
64 | * |
||
65 | * @param string $rootNamespace |
||
66 | * |
||
67 | * @return string |
||
68 | */ |
||
69 | protected function getDefaultNamespace($rootNamespace) |
||
73 | |||
74 | /** |
||
75 | * Get the console command options. |
||
76 | * |
||
77 | * @return array |
||
78 | */ |
||
79 | protected function getOptions() |
||
86 | } |
||
87 |
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.