1 | <?php |
||
23 | class ConnectionsController extends AbstractController |
||
24 | { |
||
25 | /** |
||
26 | * The template base path |
||
27 | */ |
||
28 | const TEMPLATE_BASE = parent::TEMPLATE_BASE . '/connections'; |
||
29 | |||
30 | /** |
||
31 | * The index view template path |
||
32 | */ |
||
33 | const TEMPLATE_INDEX = self::TEMPLATE_BASE . '/index'; |
||
34 | |||
35 | /** |
||
36 | * The index view template path |
||
37 | */ |
||
38 | const TEMPLATE_UPSERT = self::TEMPLATE_BASE . '/upsert'; |
||
39 | |||
40 | /** |
||
41 | * @return Response |
||
42 | * @throws \yii\base\InvalidConfigException |
||
43 | */ |
||
44 | public function actionIndex(): Response |
||
57 | |||
58 | /** |
||
59 | * @param null $identifier |
||
60 | * @param Connection|null $connection |
||
61 | * @return Response |
||
62 | * @throws \craft\errors\MissingComponentException |
||
63 | * @throws \yii\base\InvalidConfigException |
||
64 | */ |
||
65 | public function actionUpsert($identifier = null, Connection $connection = null): Response |
||
100 | |||
101 | /** |
||
102 | * @return array |
||
103 | * @throws \yii\base\InvalidConfigException |
||
104 | */ |
||
105 | private function getAvailableConnections() |
||
120 | |||
121 | /******************************************* |
||
122 | * BASE PATHS |
||
123 | *******************************************/ |
||
124 | |||
125 | /** |
||
126 | * @return string |
||
127 | */ |
||
128 | protected function getBaseCpPath(): string |
||
132 | |||
133 | /** |
||
134 | * @return string |
||
135 | */ |
||
136 | protected function getBaseActionPath(): string |
||
140 | |||
141 | /******************************************* |
||
142 | * UPDATE VARIABLES |
||
143 | *******************************************/ |
||
144 | |||
145 | /** |
||
146 | * @param array $variables |
||
147 | * @param Connection $connection |
||
148 | */ |
||
149 | protected function updateVariables(array &$variables, Connection $connection) |
||
159 | } |
||
160 |
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.