1 | <?php |
||
9 | class RepositoryMakeCommand extends GeneratorCommand |
||
10 | { |
||
11 | /** |
||
12 | * The console command name. |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $name = 'g:repository'; |
||
17 | |||
18 | /** |
||
19 | * The console command description. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $description = 'Create a new repository class'; |
||
24 | |||
25 | /** |
||
26 | * The type of class being generated. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $type = 'Repository'; |
||
31 | |||
32 | /** |
||
33 | * Get the stub file for the generator. |
||
34 | * |
||
35 | * @return string |
||
36 | */ |
||
37 | 1 | protected function getStub() |
|
41 | |||
42 | /** |
||
43 | * Get the default namespace for the class. |
||
44 | * |
||
45 | * @param string $rootNamespace |
||
46 | * |
||
47 | * @return string |
||
48 | */ |
||
49 | 1 | protected function getDefaultNamespace($rootNamespace) |
|
53 | |||
54 | /** |
||
55 | * Build the class with the given name. |
||
56 | * |
||
57 | * @param string $name |
||
58 | * |
||
59 | * @return string |
||
60 | */ |
||
61 | 1 | protected function buildClass($name) |
|
92 | |||
93 | /** |
||
94 | * renderServiceProvider. |
||
95 | * |
||
96 | * @param string $className |
||
97 | * @return string |
||
98 | */ |
||
99 | 1 | protected function renderServiceProvider($className) |
|
110 | |||
111 | /** |
||
112 | * Get the destination class path. |
||
113 | * |
||
114 | * @param string $name |
||
115 | * |
||
116 | * @return string |
||
117 | */ |
||
118 | 1 | protected function getPath($name) |
|
122 | |||
123 | /** |
||
124 | * Get the fully-qualified model class name. |
||
125 | * |
||
126 | * @param string $model |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | 1 | protected function parseModel($model) |
|
144 | |||
145 | /** |
||
146 | * Get the console command options. |
||
147 | * |
||
148 | * @return array |
||
149 | */ |
||
150 | 1 | protected function getOptions() |
|
158 | } |
||
159 |
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.