@@ -209,23 +209,19 @@ public function getSqlResultForSelectableTables(string $db)
209209 /**
210210 * Function to get html for tracking report and tracking report export
211211 *
212- * @param array $data data
213- * @param array $url_params url params
214- * @param bool $selection_schema selection schema
215- * @param bool $selection_data selection data
216- * @param bool $selection_both selection both
217- * @param int $filter_ts_to filter time stamp from
218- * @param int $filter_ts_from filter time stamp tp
219- * @param array $filter_users filter users
212+ * @param array $data data
213+ * @param array $url_params url params
214+ * @param int $filter_ts_to filter time stamp from
215+ * @param int $filter_ts_from filter time stamp tp
216+ * @param array $filter_users filter users
217+ * @psalm-param 'schema'|'data'|'schema_and_data' $logType
220218 *
221219 * @return string
222220 */
223221 public function getHtmlForTrackingReport (
224222 array $ data ,
225223 array $ url_params ,
226- $ selection_schema ,
227- $ selection_data ,
228- $ selection_both ,
224+ string $ logType ,
229225 $ filter_ts_to ,
230226 $ filter_ts_from ,
231227 array $ filter_users
@@ -238,11 +234,7 @@ public function getHtmlForTrackingReport(
238234 . htmlspecialchars ($ data ['tracking ' ]) . '</small><br> ' ;
239235 $ html .= '<br> ' ;
240236
241- [$ str1 , $ str2 , $ str3 , $ str4 , $ str5 ] = $ this ->getHtmlForElementsOfTrackingReport (
242- $ selection_schema ,
243- $ selection_data ,
244- $ selection_both
245- );
237+ [$ str1 , $ str2 , $ str3 , $ str4 , $ str5 ] = $ this ->getHtmlForElementsOfTrackingReport ($ logType );
246238
247239 // Prepare delete link content here
248240 $ drop_image_or_text = '' ;
@@ -266,9 +258,7 @@ public function getHtmlForTrackingReport(
266258 $ html .= $ this ->getHtmlForTrackingReportExportForm1 (
267259 $ data ,
268260 $ url_params ,
269- $ selection_schema ,
270- $ selection_data ,
271- $ selection_both ,
261+ $ logType ,
272262 $ filter_ts_to ,
273263 $ filter_ts_from ,
274264 $ filter_users ,
@@ -290,26 +280,21 @@ public function getHtmlForTrackingReport(
290280 /**
291281 * Generate HTML element for report form
292282 *
293- * @param bool $selection_schema selection schema
294- * @param bool $selection_data selection data
295- * @param bool $selection_both selection both
283+ * @psalm-param 'schema'|'data'|'schema_and_data' $logType
296284 *
297285 * @return array
298286 */
299- public function getHtmlForElementsOfTrackingReport (
300- $ selection_schema ,
301- $ selection_data ,
302- $ selection_both
303- ) {
287+ public function getHtmlForElementsOfTrackingReport (string $ logType )
288+ {
304289 $ str1 = '<select name="logtype"> '
305290 . '<option value="schema" '
306- . ($ selection_schema ? ' selected="selected" ' : '' ) . '> '
291+ . ($ logType === ' schema ' ? ' selected="selected" ' : '' ) . '> '
307292 . __ ('Structure only ' ) . '</option> '
308293 . '<option value="data" '
309- . ($ selection_data ? ' selected="selected" ' : '' ) . '> '
294+ . ($ logType === ' data ' ? ' selected="selected" ' : '' ) . '> '
310295 . __ ('Data only ' ) . '</option> '
311296 . '<option value="schema_and_data" '
312- . ($ selection_both ? ' selected="selected" ' : '' ) . '> '
297+ . ($ logType === ' schema_and_data ' ? ' selected="selected" ' : '' ) . '> '
313298 . __ ('Structure and data ' ) . '</option> '
314299 . '</select> ' ;
315300 $ str2 = '<input type="text" name="date_from" value=" '
@@ -335,9 +320,6 @@ public function getHtmlForElementsOfTrackingReport(
335320 *
336321 * @param array $data data
337322 * @param array $url_params url params
338- * @param bool $selection_schema selection schema
339- * @param bool $selection_data selection data
340- * @param bool $selection_both selection both
341323 * @param int $filter_ts_to filter time stamp from
342324 * @param int $filter_ts_from filter time stamp tp
343325 * @param array $filter_users filter users
@@ -347,15 +329,14 @@ public function getHtmlForElementsOfTrackingReport(
347329 * @param string $str4 HTML for user
348330 * @param string $str5 HTML for "list report"
349331 * @param string $drop_image_or_text HTML for image or text
332+ * @psalm-param 'schema'|'data'|'schema_and_data' $logType
350333 *
351334 * @return string HTML for form
352335 */
353336 public function getHtmlForTrackingReportExportForm1 (
354337 array $ data ,
355338 array $ url_params ,
356- $ selection_schema ,
357- $ selection_data ,
358- $ selection_both ,
339+ string $ logType ,
359340 $ filter_ts_to ,
360341 $ filter_ts_from ,
361342 array $ filter_users ,
@@ -383,7 +364,7 @@ public function getHtmlForTrackingReportExportForm1(
383364 $ str5
384365 );
385366
386- if ($ selection_schema || $ selection_both && count ($ data ['ddlog ' ]) > 0 ) {
367+ if ($ logType === ' schema ' || $ logType === ' schema_and_data ' && count ($ data ['ddlog ' ]) > 0 ) {
387368 [$ temp , $ ddlog_count ] = $ this ->getHtmlForDataDefinitionStatements (
388369 $ data ,
389370 $ filter_users ,
@@ -397,7 +378,7 @@ public function getHtmlForTrackingReportExportForm1(
397378 }
398379
399380 // Secondly, list tracked data manipulation statements
400- if (($ selection_data || $ selection_both ) && count ($ data ['dmlog ' ]) > 0 ) {
381+ if (($ logType === ' data ' || $ logType === ' schema_and_data ' ) && count ($ data ['dmlog ' ]) > 0 ) {
401382 $ html .= $ this ->getHtmlForDataManipulationStatements (
402383 $ data ,
403384 $ filter_users ,
0 commit comments