1 | <?php |
||
26 | class Controller extends \yii\web\Controller |
||
27 | { |
||
28 | /** |
||
29 | * @var Cache|array|string the cache object or the application component ID of the cache object. |
||
30 | */ |
||
31 | protected $_cache = 'cache'; |
||
32 | |||
33 | public function setCache($cache) |
||
37 | |||
38 | public function getCache() |
||
46 | |||
47 | /** |
||
48 | * @var array internal actions. |
||
49 | */ |
||
50 | protected $_internalActions; |
||
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | 1 | public function behaviors() |
|
56 | { |
||
57 | return [ |
||
58 | 'access' => [ |
||
59 | 'class' => AccessControl::class, |
||
60 | 'only' => ['index'], |
||
61 | 'rules' => [ |
||
62 | [ |
||
63 | 'actions' => ['index'], |
||
64 | 'allow' => true, |
||
65 | 'roles' => ['@'], |
||
66 | ], |
||
67 | ], |
||
68 | ], |
||
69 | 1 | ]; |
|
70 | } |
||
71 | |||
72 | /** |
||
73 | * @param string $submodel the submodel that will be added to the ClassName |
||
|
|||
74 | * @return string Main Model class name |
||
75 | */ |
||
76 | public static function modelClassName() |
||
86 | |||
87 | /** |
||
88 | * @param array $config config to be used to create the [[Model]] |
||
89 | * @return ActiveRecord |
||
90 | */ |
||
91 | public static function newModel($config = [], $submodel = '') |
||
96 | |||
97 | /** |
||
98 | * @param array $config config to be used to create the [[Model]] |
||
99 | * @return ActiveRecord|SearchModelTrait Search Model object |
||
100 | */ |
||
101 | public static function searchModel($config = []) |
||
105 | |||
106 | /** |
||
107 | * @return string main model's formName() |
||
108 | */ |
||
109 | public static function formName() |
||
113 | |||
114 | /** |
||
115 | * @return string search model's formName() |
||
116 | */ |
||
117 | public static function searchFormName() |
||
121 | |||
122 | /** |
||
123 | * @param string $separator |
||
124 | * @return string Main model's camel2id'ed formName() |
||
125 | */ |
||
126 | public static function modelId($separator = '-') |
||
130 | |||
131 | /** |
||
132 | * Returns the module ID based on the namespace of the controller. |
||
133 | * @return mixed |
||
134 | */ |
||
135 | public static function moduleId() |
||
139 | |||
140 | public static function controllerId() |
||
144 | |||
145 | /** |
||
146 | * @param int|array $condition scalar ID or array to be used for searching |
||
147 | * @param array $config config to be used to create the [[Model]] |
||
148 | * @throws NotFoundHttpException |
||
149 | * @return array|ActiveRecord|null|static |
||
150 | */ |
||
151 | public static function findModel($condition, $config = []) |
||
161 | |||
162 | public static function findModels($condition, $config = []) |
||
184 | |||
185 | public static function renderJson($data) |
||
191 | |||
192 | public static function renderJsonp($data) |
||
198 | |||
199 | public function actionIndex() |
||
203 | |||
204 | public function setInternalAction($id, $action) |
||
208 | |||
209 | public function hasInternalAction($id) |
||
213 | |||
214 | public function createAction($id) |
||
219 | |||
220 | /** |
||
221 | * Prepares array for building url to action based on given action id and parameters. |
||
222 | * |
||
223 | * @param string $action action id |
||
224 | * @param string|int|array $params ID of object to be action'ed or array of parameters |
||
225 | * @return array array suitable for Url::to |
||
226 | */ |
||
227 | public static function getActionUrl($action = 'index', $params = []) |
||
232 | |||
233 | /** |
||
234 | * Prepares array for building url to search with given filters. |
||
235 | */ |
||
236 | public static function getSearchUrl(array $params = []) |
||
240 | } |
||
241 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.