1 | <?php |
||
5 | class ControllerGenerator extends Generator |
||
6 | { |
||
7 | /** |
||
8 | * Get stub name. |
||
9 | * |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $stub = 'controller/controller'; |
||
13 | |||
14 | /** |
||
15 | * Get root namespace. |
||
16 | * |
||
17 | * @return string |
||
18 | */ |
||
19 | public function getRootNamespace() |
||
23 | |||
24 | /** |
||
25 | * Get generator path config node. |
||
26 | * |
||
27 | * @return string |
||
28 | */ |
||
29 | public function getPathConfigNode() |
||
33 | |||
34 | /** |
||
35 | * Get destination path for generated file. |
||
36 | * |
||
37 | * @return string |
||
38 | */ |
||
39 | public function getPath() |
||
43 | |||
44 | /** |
||
45 | * Get base path of destination file. |
||
46 | * |
||
47 | * @return string |
||
48 | */ |
||
49 | public function getBasePath() |
||
53 | |||
54 | /** |
||
55 | * Gets controller name based on model. |
||
56 | * |
||
57 | * @return string |
||
58 | */ |
||
59 | public function getControllerName() |
||
63 | |||
64 | /** |
||
65 | * Gets plural name based on model. |
||
66 | * |
||
67 | * @return string |
||
68 | */ |
||
69 | public function getPluralName() |
||
73 | |||
74 | /** |
||
75 | * Get array replacements. |
||
76 | * |
||
77 | * @return array |
||
78 | */ |
||
79 | public function getReplacements() |
||
90 | |||
91 | /** |
||
92 | * Gets singular name based on model. |
||
93 | * |
||
94 | * @return string |
||
95 | */ |
||
96 | public function getSingularName() |
||
100 | |||
101 | /** |
||
102 | * Gets validator full class name. |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | public function getValidator() |
||
119 | |||
120 | /** |
||
121 | * Gets repository full class name. |
||
122 | * |
||
123 | * @return string |
||
124 | */ |
||
125 | public function getRepository() |
||
138 | } |
||
139 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.