1 | <?php |
||
33 | class CreateController extends Base implements TaskInterface |
||
34 | { |
||
35 | /** |
||
36 | * @readwrite |
||
37 | * @var string |
||
38 | */ |
||
39 | protected $entityName; |
||
40 | |||
41 | /** |
||
42 | * @readwrite |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $controllerName; |
||
46 | |||
47 | /** |
||
48 | * @readwrite |
||
49 | * @var string |
||
50 | */ |
||
51 | protected $namespace; |
||
52 | |||
53 | /** |
||
54 | * @readwrite |
||
55 | * @var string |
||
56 | */ |
||
57 | protected $sourcePath; |
||
58 | |||
59 | /** |
||
60 | * @var string |
||
61 | */ |
||
62 | protected $basePath; |
||
63 | |||
64 | /** |
||
65 | * @var string |
||
66 | */ |
||
67 | protected $controllerFile; |
||
68 | |||
69 | /** |
||
70 | * For input/output getters and setters |
||
71 | */ |
||
72 | use ConsoleAwareMethods; |
||
73 | |||
74 | /** |
||
75 | * @var Controller |
||
76 | */ |
||
77 | protected $controllerMetaData; |
||
78 | |||
79 | /** |
||
80 | * @var TemplateEngineInterface |
||
81 | */ |
||
82 | protected $templateEngine; |
||
83 | |||
84 | /** |
||
85 | * @var QuestionHelper |
||
86 | */ |
||
87 | protected $questionHelper; |
||
88 | |||
89 | protected $template = 'controller.twig'; |
||
90 | |||
91 | /** |
||
92 | * Runs this task |
||
93 | * |
||
94 | * @return boolean |
||
95 | */ |
||
96 | 8 | public function run() |
|
117 | |||
118 | /** |
||
119 | * Gets controllerMetaData property |
||
120 | * |
||
121 | * @return Controller |
||
122 | */ |
||
123 | 8 | public function getControllerMetaData() |
|
132 | |||
133 | /** |
||
134 | * Sets controllerMetaData property |
||
135 | * |
||
136 | * @param Controller $controllerMetaData |
||
137 | * |
||
138 | * @return CreateController |
||
139 | */ |
||
140 | 8 | public function setControllerMetaData(Controller $controllerMetaData) |
|
145 | |||
146 | /** |
||
147 | * Gets templateEngine property |
||
148 | * |
||
149 | * @return TemplateEngineInterface |
||
150 | */ |
||
151 | 8 | public function getTemplateEngine() |
|
160 | |||
161 | /** |
||
162 | * Sets templateEngine property |
||
163 | * |
||
164 | * @param TemplateEngineInterface $templateEngine |
||
165 | * |
||
166 | * @return CreateController |
||
167 | */ |
||
168 | 8 | public function setTemplateEngine(TemplateEngineInterface $templateEngine) |
|
173 | |||
174 | /** |
||
175 | * Gets basePath property |
||
176 | * |
||
177 | * @return string |
||
178 | */ |
||
179 | 8 | public function getBasePath() |
|
186 | |||
187 | /** |
||
188 | * Gets controllerFile property |
||
189 | * |
||
190 | * @return string |
||
191 | */ |
||
192 | 20 | public function getControllerFile() |
|
202 | |||
203 | /** |
||
204 | * Sets controllerFile property |
||
205 | * |
||
206 | * @param string $controllerFile |
||
207 | * |
||
208 | * @return CreateController |
||
209 | */ |
||
210 | 20 | public function setControllerFile($controllerFile) |
|
215 | |||
216 | /** |
||
217 | * Gets questionHelper property |
||
218 | * |
||
219 | * @return QuestionHelper |
||
220 | */ |
||
221 | 6 | public function getQuestionHelper() |
|
228 | |||
229 | /** |
||
230 | * Sets questionHelper property |
||
231 | * |
||
232 | * @param QuestionHelper $questionHelper |
||
233 | * |
||
234 | * @return CreateController |
||
235 | */ |
||
236 | 6 | public function setQuestionHelper(QuestionHelper $questionHelper) |
|
241 | |||
242 | /** |
||
243 | * Configures the controller generator |
||
244 | * |
||
245 | * @param Controller $controller |
||
246 | */ |
||
247 | 8 | protected function configureController(Controller $controller) |
|
255 | |||
256 | /** |
||
257 | * Check controller file existence and ask if can be overridden |
||
258 | * |
||
259 | * @return bool |
||
260 | */ |
||
261 | 8 | protected function overrideFile() |
|
279 | } |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.