phpmyadmin/libraries/classes/Controllers
Kamil Tekiela 51f4017b32
Refactor destroy controller (#17194)
* Remove redundant conditions

They were always true. First, the variable is set to -1.
If the variable is -1, then set it to Message.
If the variable is Message then set the JSON array. All of this is
redundant.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* $sqlQuery is not used anywhere

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Enforce $selected to be an array

I can't remove it as it is a global. Previously, it was set to a POST
variable. Since we validate that the variable is set and is not null,
we can use the value from $params. If we validate that it's also an
array we can replace for loop with foreach.
There is no passing by reference, so this change should be safe.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Replace $rebuildDatabaseList with input validation

The validation message says 'No databases selected.' so I assume that
we should check that we actually got at least one entry in the list.
If that is true, then the $rebuildDatabaseList is not needed and the
condition redundant.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* drop_selected_dbs is always set and is redundant

I am not sure if this is necessary. The AJAX request sends a value of "1"
but the code doesn't really do anything with it other than checking if
it is actually set. Is there some other path possible?

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Flatten the array with a single element

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove redundant isset

The variable is set, so !isset === is_null. Why check for null if we can
check just for !is_array.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Update psalm-baseline.xml

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Adhere to the coding standard

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-11-19 14:26:04 -03:00
..
Config Add type declarations to the controllers contructors 2021-09-11 17:32:22 -03:00
Database Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
Export Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
Preferences Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
Server Refactor destroy controller (#17194) 2021-11-19 14:26:04 -03:00
Setup Add type declarations to the controllers contructors 2021-09-11 17:32:22 -03:00
Sql Remove useless whitespaces 2021-09-15 17:05:40 -03:00
Table Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
Transformation Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
View Remove useless whitespaces 2021-09-15 17:05:40 -03:00
AbstractController.php Add type declarations to the controllers contructors 2021-09-11 17:32:22 -03:00
BrowseForeignersController.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
ChangeLogController.php Remove useless string concatenations 2021-09-27 21:40:22 -03:00
CheckRelationsController.php Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
CollationConnectionController.php Add type declarations to the controllers contructors 2021-09-11 17:32:22 -03:00
ColumnController.php Add type declarations to the controllers contructors 2021-09-11 17:32:22 -03:00
DatabaseController.php Make controllers callable 2021-08-30 13:16:29 -03:00
ErrorReportController.php Remove useless string concatenations 2021-09-27 21:40:22 -03:00
GisDataEditorController.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
GitInfoController.php Add type declarations to the controllers contructors 2021-09-11 17:32:22 -03:00
HomeController.php Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
ImportController.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
ImportStatusController.php Add type declarations to the controllers contructors 2021-09-11 17:32:22 -03:00
JavaScriptMessagesController.php Remove printview.css theme files 2021-10-31 17:35:55 -03:00
LicenseController.php Remove useless string concatenations 2021-09-27 21:40:22 -03:00
LintController.php Make controllers callable 2021-08-30 13:16:29 -03:00
LogoutController.php Make controllers callable 2021-08-30 13:16:29 -03:00
NavigationController.php Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
NormalizationController.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
PhpInfoController.php Make controllers callable 2021-08-30 13:16:29 -03:00
RecentTablesListController.php Extract controllers from HomeController 2021-09-05 00:40:18 -03:00
SchemaExportController.php Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
TableController.php Add type declarations to the controllers contructors 2021-09-11 17:32:22 -03:00
ThemesController.php Add type declarations to the controllers contructors 2021-09-11 17:32:22 -03:00
ThemeSetController.php Add type declarations to the controllers contructors 2021-09-11 17:32:22 -03:00
UserPasswordController.php Add type declarations to the controllers contructors 2021-09-11 17:32:22 -03:00
VersionCheckController.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00