phpmyadmin/libraries/classes
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
..
Charsets Fix some errors found by Psalm 2021-11-08 00:52:30 -03:00
Command Remove useless whitespaces 2021-09-15 17:05:40 -03:00
Config Remove unnecessary @var annotations 2021-11-18 12:15:30 -03:00
Controllers Refactor destroy controller (#17194) 2021-11-19 14:26:04 -03:00
Database Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
Dbal Fix some issues found by PHPStan 2021-11-16 15:11:57 -03:00
Display Remove unnecessary @var annotations 2021-11-18 12:15:30 -03:00
Engines Remove useless string concatenations 2021-09-27 21:40:22 -03:00
Exceptions Fix some coding standard issues 2020-05-25 22:42:37 -03:00
Export Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
Gis Remove useless string concatenations 2021-09-27 21:40:22 -03:00
Html Remove unnecessary @var annotations 2021-11-18 12:15:30 -03:00
Http Add ServerRequest::getParsedBodyParam method 2021-07-06 12:24:02 -03:00
Image Fix some PHP 8.1 issues 2021-08-21 20:16:59 -03:00
Import Remove useless whitespaces 2021-09-15 17:05:40 -03:00
Navigation Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
Partitioning Use ServerRequest for Table\Partition controllers 2021-09-30 16:56:34 -03:00
Plugins Remove unnecessary @var annotations 2021-11-18 12:15:30 -03:00
Properties Remove useless whitespaces 2021-09-15 17:05:40 -03:00
Providers/ServerVariables Use PSR-12 for namespace use statements 2021-03-05 14:18:35 -03:00
Query Remove useless string concatenations 2021-09-27 21:40:22 -03:00
Server Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
Setup Remove useless string concatenations 2021-09-27 21:40:22 -03:00
Table Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
Twig Remove useless whitespaces 2021-09-15 17:05:40 -03:00
Utils Use composer/ca-bundle to manage the CA cert file 2021-10-09 12:50:51 -03:00
Advisor.php Replace pow function with the ** operator 2021-09-27 19:12:11 -03:00
Bookmark.php Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
BrowseForeigners.php Remove useless string concatenations 2021-09-27 21:40:22 -03:00
Cache.php Add bool return type where possible 2021-09-14 20:11:51 -03:00
Charsets.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
CheckUserPrivileges.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
Common.php Rename TableName|DatabaseName create method to fromString 2021-09-30 22:14:51 -03:00
Config.php Remove unnecessary @var annotations 2021-11-18 12:15:30 -03:00
Console.php Improve type definitions of Scripts class 2021-11-18 15:25:00 -03:00
Core.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
CreateAddField.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
DatabaseInterface.php Remove unnecessary @var annotations 2021-11-18 12:15:30 -03:00
DbTableExists.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
Encoding.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
Error.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
ErrorHandler.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
ErrorReport.php Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
Export.php Remove useless string concatenations 2021-09-27 21:40:22 -03:00
FieldMetadata.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
File.php Remove useless string concatenations 2021-09-27 21:40:22 -03:00
FileListing.php Use PSR-12 for control structures spacing 2021-03-05 15:27:03 -03:00
FlashMessages.php Fix coding standard errors 2021-06-03 16:50:33 -03:00
Font.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
Footer.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
Git.php Wrap variable variables in curly braces 2021-09-27 19:18:48 -03:00
Header.php Remove print view mode 2021-10-31 13:22:07 -03:00
Import.php Remove useless string concatenations 2021-09-27 21:40:22 -03:00
Index.php Remove useless string concatenations 2021-09-27 21:40:22 -03:00
IndexColumn.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
InsertEdit.php Remove unnecessary @var annotations 2021-11-18 12:15:30 -03:00
InternalRelations.php Fix some coding standard issues 2020-05-25 22:42:37 -03:00
IpAllowDeny.php Replace pow function with the ** operator 2021-09-27 19:12:11 -03:00
Language.php Add bool return type where possible 2021-09-14 20:11:51 -03:00
LanguageManager.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
Linter.php Remove unnecessary @var annotations 2021-11-18 12:15:30 -03:00
ListAbstract.php Add bool return type where possible 2021-09-14 20:11:51 -03:00
ListDatabase.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
Logging.php Add void return type where possible 2021-09-13 15:29:11 -03:00
Menu.php Remove unnecessary @var annotations 2021-11-18 12:15:30 -03:00
Message.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
Mime.php Use PSR-12 for control structures spacing 2021-03-05 15:27:03 -03:00
Normalization.php Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
OpenDocument.php Fix some PHP 8.1 issues 2021-08-21 20:16:59 -03:00
Operations.php Add Warning value object for SHOW WARNINGS rows 2021-10-09 00:09:01 -03:00
OutputBuffering.php Add void return type where possible 2021-09-13 15:29:11 -03:00
ParseAnalyze.php Rename Response class to ResponseRenderer 2021-06-30 12:35:22 -03:00
Pdf.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
Plugins.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
Profiling.php Add bool return type where possible 2021-09-14 20:11:51 -03:00
RecentFavoriteTable.php Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
Relation.php Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
RelationCleanup.php Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
RelationParameters.php Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
Replication.php Merge branch 'QA_5_1' 2021-04-28 02:12:17 +02:00
ReplicationGui.php Remove useless string concatenations 2021-09-27 21:40:22 -03:00
ReplicationInfo.php Fix some errors found by Psalm 2021-05-23 00:24:59 -03:00
ResponseRenderer.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
Routing.php Use only callable controllers 2021-09-11 15:20:46 -03:00
Sanitize.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
SavedSearches.php Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
Scripts.php Improve type definitions of Scripts class 2021-11-18 15:25:00 -03:00
Session.php Remove useless string concatenations 2021-09-27 21:40:22 -03:00
Sql.php Add test for Sql::executeQueryAndSendQueryResponse 2021-11-15 19:51:16 -03:00
SqlQueryForm.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
StorageEngine.php Remove useless string concatenations 2021-09-27 21:40:22 -03:00
SystemDatabase.php Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
Table.php Remove unnecessary @var annotations 2021-11-18 12:15:30 -03:00
Template.php Remove PhpMyAdmin\Twig\PluginsExtension class 2021-08-25 11:00:21 -03:00
Theme.php Remove the unused Theme::cssFiles property 2021-11-03 09:21:43 -03:00
ThemeManager.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
Tracker.php Fix some issues found by PHPStan 2021-11-16 15:11:57 -03:00
Tracking.php Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
Transformations.php Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
TwoFactor.php Replace class strings with the ::class constant 2021-09-27 19:17:45 -03:00
Types.php Remove useless string concatenations 2021-09-27 21:40:22 -03:00
Url.php Merge branch 'QA_5_1' 2021-09-23 13:10:38 -03:00
UserPassword.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
UserPreferences.php Create the RelationParameters value object 2021-11-14 18:22:36 -03:00
Util.php Remove array support from Util::backquote 2021-11-10 19:33:09 -03:00
Version.php Fix some errors found by PHPStan 2021-06-09 13:07:40 -03:00
VersionInformation.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00
ZipExtension.php Remove useless whitespaces 2021-09-15 17:05:40 -03:00