1 | <?php |
||
23 | class Module extends BaseModule |
||
24 | { |
||
25 | /** |
||
26 | * Main layout for other child templates. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | public $layout = '@admin/views/layouts/main-admin.php'; |
||
31 | |||
32 | /** |
||
33 | * Login url. |
||
34 | * |
||
35 | * @var null|string|array |
||
36 | */ |
||
37 | public $loginUrl = null; |
||
38 | |||
39 | /** |
||
40 | * Set multilanguage mode. |
||
41 | * |
||
42 | * @var bool |
||
43 | */ |
||
44 | public $isMultilanguage = false; |
||
45 | |||
46 | /** |
||
47 | * Array of roles to module access. |
||
48 | * |
||
49 | * @var array |
||
50 | */ |
||
51 | public $accessRoles = ['@']; |
||
52 | |||
53 | /** |
||
54 | * View component to render content. |
||
55 | * |
||
56 | * @var AdminView |
||
57 | */ |
||
58 | private $_view = null; |
||
59 | |||
60 | /** |
||
61 | * Module translations. |
||
62 | * |
||
63 | * @var array|null |
||
64 | */ |
||
65 | private static $_translations = null; |
||
66 | |||
67 | /** |
||
68 | * @inheritdoc |
||
69 | */ |
||
70 | public function init() |
||
92 | |||
93 | /** |
||
94 | * Get the view. |
||
95 | * |
||
96 | * @return AdminView |
||
97 | */ |
||
98 | public function getView() |
||
106 | |||
107 | /** |
||
108 | * Returns module root directory. |
||
109 | * |
||
110 | * @return string |
||
111 | */ |
||
112 | public static function getBaseDir(): string |
||
116 | |||
117 | /** |
||
118 | * Module translator. |
||
119 | * |
||
120 | * @param $category |
||
121 | * @param $message |
||
122 | * @param array $params |
||
123 | * @param null $language |
||
124 | * |
||
125 | * @return string |
||
126 | */ |
||
127 | public static function t($category, $message, $params = [], $language = null) |
||
135 | |||
136 | /** |
||
137 | * Set i18N component. |
||
138 | * |
||
139 | * @return void |
||
140 | */ |
||
141 | private static function registerTranslations(): void |
||
162 | } |
||
163 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: