1 | <?php |
||
17 | class listener_helper |
||
18 | { |
||
19 | /** @var auth */ |
||
20 | protected $auth; |
||
21 | |||
22 | /** @var config */ |
||
23 | protected $config; |
||
24 | |||
25 | /** @var request */ |
||
26 | protected $request; |
||
27 | |||
28 | /** @var int quickedit forums flag */ |
||
29 | const QUICKEDIT_FLAG = 128; |
||
30 | |||
31 | /** |
||
32 | * Constructor for listener |
||
33 | * |
||
34 | 29 | * @param auth $auth phpBB auth |
|
35 | * @param config $config phpBB config |
||
36 | 29 | * @param request_interface $request $request phpBB request |
|
37 | 29 | */ |
|
38 | 29 | public function __construct(auth $auth, config $config, request_interface $request) |
|
44 | |||
45 | /** |
||
46 | * Check if request is a catchable request |
||
47 | * |
||
48 | 3 | * @param object $event The event object |
|
49 | * @return bool True if it's a catchable request, false if not |
||
50 | 3 | */ |
|
51 | public function is_catchable_request($event) : bool |
||
55 | |||
56 | /** |
||
57 | * Add hidden fields in order to prevent dropping the needed values upon |
||
58 | * submission. |
||
59 | * |
||
60 | * @param object $event The event object |
||
61 | 2 | * @return void |
|
62 | */ |
||
63 | 2 | public function add_hidden_fields(&$event) |
|
95 | 2 | ||
96 | /** |
||
97 | * Returns value if it is set, otherwise the default |
||
98 | * |
||
99 | * @param mixed $value The variable to check |
||
100 | * @param mixed $default The default value to use if variable is not set |
||
101 | * @return mixed Value if variable is set, default value if not |
||
102 | */ |
||
103 | protected function isset_or_default($value, $default) |
||
104 | { |
||
105 | return $value ?? $default; |
||
106 | } |
||
107 | 2 | ||
108 | /** |
||
109 | 2 | * Returns value if it's not empty, otherwise the default |
|
110 | * |
||
111 | * @param mixed $check_value The variable to check |
||
112 | * @param mixed $value The value if $check_value is not empty |
||
113 | * @param mixed $default The default value to use if variable is empty |
||
114 | * @return mixed Value if $check_value is not empty, default value if not |
||
115 | */ |
||
116 | protected function not_empty_or_default($check_value, $value, $default) |
||
120 | |||
121 | 1 | /** |
|
122 | 1 | * Enable quick edit |
|
123 | 1 | * |
|
124 | 1 | * @param object $event The event object |
|
125 | 1 | * @return void |
|
126 | 1 | */ |
|
127 | 1 | public function enable_quick_edit($event) |
|
137 | 1 | ||
138 | /** |
||
139 | * Add quickedit settings to acp settings by modifying the display vars |
||
140 | 1 | * |
|
141 | 1 | * @param object $event The event object |
|
142 | 1 | * @return void |
|
143 | */ |
||
144 | 1 | public function modify_acp_display_vars($event) |
|
167 | |||
168 | 2 | /** |
|
169 | * Check whether user can edit in this topic and forum |
||
170 | 2 | * |
|
171 | 2 | * @param object $event The event object |
|
172 | 1 | * @return bool True if user can edit in this topic or forum, else false |
|
173 | */ |
||
174 | public function check_topic_edit($event) : bool |
||
185 | |||
186 | /** |
||
187 | * Check forum_permissions and flag |
||
188 | 2 | * |
|
189 | * @param object $event The event object |
||
190 | 2 | * @return bool True if quickedit is enabled and user can reply in forum, |
|
191 | 2 | * false if not |
|
192 | 1 | */ |
|
193 | public function check_forum_permissions($event) : bool |
||
204 | |||
205 | /** |
||
206 | * Add data to hidden fields if column exists in post_data array |
||
207 | * |
||
208 | * @param string $hidden_fields Hidden fields data |
||
209 | 2 | * @param array $data_array post_data array |
|
210 | * @param string $column Column name |
||
211 | 2 | * |
|
212 | 2 | * @return string Hidden fields data |
|
213 | 1 | */ |
|
214 | 1 | protected function add_hidden_if_exists(string $hidden_fields, array $data_array, string $column) : string |
|
225 | } |
||
226 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..