diff --git a/browse_foreigners.php b/browse_foreigners.php index 10d0fad64b..4495606f93 100644 --- a/browse_foreigners.php +++ b/browse_foreigners.php @@ -23,7 +23,7 @@ require_once ROOT_PATH . 'libraries/common.inc.php'; */ $request_params = [ 'data', - 'field' + 'field', ]; foreach ($request_params as $one_request_param) { diff --git a/db_operations.php b/db_operations.php index f88285d6d0..76a6368e02 100644 --- a/db_operations.php +++ b/db_operations.php @@ -103,7 +103,7 @@ if (strlen($GLOBALS['db']) > 0 'libraries/classes/Plugins/Export/', [ 'single_table' => isset($single_table), - 'export_type' => 'database' + 'export_type' => 'database', ] ); diff --git a/examples/signon-script.php b/examples/signon-script.php index f32a582413..202dca8c05 100644 --- a/examples/signon-script.php +++ b/examples/signon-script.php @@ -25,11 +25,17 @@ function get_login_credentials($user) { /* Optionally we can use passed username */ if (! empty($user)) { - return [$user, 'password']; + return [ + $user, + 'password', + ]; } /* Here we would retrieve the credentials */ - $credentials = ['root', '']; + $credentials = [ + 'root', + '', + ]; return $credentials; } diff --git a/export.php b/export.php index fbae9adcb2..7d6f623368 100644 --- a/export.php +++ b/export.php @@ -172,7 +172,7 @@ $post_params = [ 'latex_data_continued_caption', 'latex_data_label', 'latex_null', - 'aliases' + 'aliases', ]; foreach ($post_params as $one_post_param) { @@ -196,7 +196,7 @@ $export_plugin = Plugins::getPlugin( 'libraries/classes/Plugins/Export/', [ 'export_type' => $export_type, - 'single_table' => isset($single_table) + 'single_table' => isset($single_table), ] ); @@ -210,7 +210,7 @@ if (empty($export_plugin)) { */ $compression_methods = [ 'zip', - 'gzip' + 'gzip', ]; /** @@ -291,7 +291,8 @@ if ($export_type == 'server') { } elseif ($export_type == 'table' && strlen($db) > 0 && strlen($table) > 0) { $err_url = 'tbl_export.php' . Url::getCommon( [ - 'db' => $db, 'table' => $table + 'db' => $db, + 'table' => $table, ] ); } else { diff --git a/gis_data_editor.php b/gis_data_editor.php index 12183826b1..f7ca095c59 100644 --- a/gis_data_editor.php +++ b/gis_data_editor.php @@ -39,7 +39,7 @@ $gis_types = [ 'MULTILINESTRING', 'POLYGON', 'MULTIPOLYGON', - 'GEOMETRYCOLLECTION' + 'GEOMETRYCOLLECTION', ]; // Extract type from the initial call and make sure that it's a valid one. @@ -83,9 +83,14 @@ $result = "'" . $wkt . "'," . $srid; $visualizationSettings = [ 'width' => 450, 'height' => 300, - 'spatialColumn' => 'wkt' + 'spatialColumn' => 'wkt', +]; +$data = [ + [ + 'wkt' => $wkt_with_zero, + 'srid' => $srid, + ], ]; -$data = [['wkt' => $wkt_with_zero, 'srid' => $srid]]; $visualization = GisVisualization::getByData($data, $visualizationSettings) ->toImage('svg'); diff --git a/import.php b/import.php index a4828b1401..99363f6da3 100644 --- a/import.php +++ b/import.php @@ -105,7 +105,7 @@ $post_params = [ 'message_to_show', 'noplugin', 'skip_queries', - 'local_import_file' + 'local_import_file', ]; foreach ($post_params as $one_post_param) { @@ -246,7 +246,7 @@ if (! in_array( 'ods', 'shp', 'sql', - 'xml' + 'xml', ] ) ) { @@ -257,7 +257,7 @@ if (! in_array( $post_patterns = [ '/^force_file_/', - '/^' . $format . '_/' + '/^' . $format . '_/', ]; Core::setPostAsGlobal($post_patterns); @@ -269,7 +269,10 @@ PhpMyAdmin\Util::checkParameters(['import_type', 'format']); $format = Core::securePath($format); if (strlen($table) > 0 && strlen($db) > 0) { - $urlparams = ['db' => $db, 'table' => $table]; + $urlparams = [ + 'db' => $db, + 'table' => $table, + ]; } elseif (strlen($db) > 0) { $urlparams = ['db' => $db]; } else { @@ -538,7 +541,10 @@ if (! $error && isset($_POST['skip'])) { // This array contain the data like numberof valid sql queries in the statement // and complete valid sql statement (which affected for rows) -$sql_data = ['valid_sql' => [], 'valid_queries' => 0]; +$sql_data = [ + 'valid_sql' => [], + 'valid_queries' => 0, +]; if (! $error) { /** diff --git a/index.php b/index.php index 3743898ec9..c5f74977d3 100644 --- a/index.php +++ b/index.php @@ -40,7 +40,7 @@ $drops = [ 'server', 'collation_connection', 'db', - 'table' + 'table', ]; foreach ($drops as $each_drop) { if (array_key_exists($each_drop, $_GET)) { @@ -55,7 +55,8 @@ unset($drops, $each_drop); * */ $target_blacklist = [ - 'import.php', 'export.php' + 'import.php', + 'export.php', ]; // If we have a valid target, let's load that script instead diff --git a/js/messages.php b/js/messages.php index f1f8b7e6bf..76ff2b0128 100644 --- a/js/messages.php +++ b/js/messages.php @@ -810,7 +810,7 @@ Sanitize::printJsValue( __('September'), __('October'), __('November'), - __('December') + __('December'), ] ); Sanitize::printJsValue( @@ -839,7 +839,7 @@ Sanitize::printJsValue( /* l10n: Short month name */ __('Nov'), /* l10n: Short month name */ - __('Dec') + __('Dec'), ] ); Sanitize::printJsValue( @@ -851,7 +851,7 @@ Sanitize::printJsValue( __('Wednesday'), __('Thursday'), __('Friday'), - __('Saturday') + __('Saturday'), ] ); Sanitize::printJsValue( @@ -870,7 +870,7 @@ Sanitize::printJsValue( /* l10n: Short week day name */ __('Fri'), /* l10n: Short week day name */ - __('Sat') + __('Sat'), ] ); Sanitize::printJsValue( @@ -889,7 +889,7 @@ Sanitize::printJsValue( /* l10n: Minimal week day name */ __('Fr'), /* l10n: Minimal week day name */ - __('Sa') + __('Sa'), ] ); /* l10n: Column header for week of the year in calendar */ diff --git a/libraries/classes/Advisor.php b/libraries/classes/Advisor.php index 15f07ca8bd..139d1e8c67 100644 --- a/libraries/classes/Advisor.php +++ b/libraries/classes/Advisor.php @@ -237,7 +237,7 @@ class Advisor return [ 'parse' => ['errors' => $this->parseResult['errors']], - 'run' => $this->runResult + 'run' => $this->runResult, ]; } @@ -375,7 +375,10 @@ class Advisor { $jst = preg_split('/\s*\|\s*/', $rule['justification'], 2); if (count($jst) > 1) { - return [$jst[0], $jst[1]]; + return [ + $jst[0], + $jst[1], + ]; } return [$rule['justification']]; } @@ -421,14 +424,20 @@ class Advisor // linking to server_variables.php $rule['recommendation'] = preg_replace_callback( '/\{([a-z_0-9]+)\}/Ui', - [$this, 'replaceVariable'], + [ + $this, + 'replaceVariable', + ], $this->translate($rule['recommendation']) ); // Replaces external Links with Core::linkURL() generated links $rule['recommendation'] = preg_replace_callback( '#href=("|\')(https?://[^\1]+)\1#i', - [$this, 'replaceLinkURL'], + [ + $this, + 'replaceLinkURL', + ], $rule['recommendation'] ); break; @@ -504,11 +513,20 @@ class Advisor __('Error in reading file: The file \'%s\' does not exist or is not readable!'), $filename ); - return ['rules' => $rules, 'lines' => $lines, 'errors' => $errors]; + return [ + 'rules' => $rules, + 'lines' => $lines, + 'errors' => $errors, + ]; } $ruleSyntax = [ - 'name', 'formula', 'test', 'issue', 'recommendation', 'justification' + 'name', + 'formula', + 'test', + 'issue', + 'recommendation', + 'justification', ]; $numRules = count($ruleSyntax); $numLines = count($file); @@ -589,7 +607,11 @@ class Advisor } } - return ['rules' => $rules, 'lines' => $lines, 'errors' => $errors]; + return [ + 'rules' => $rules, + 'lines' => $lines, + 'errors' => $errors, + ]; } /** diff --git a/libraries/classes/BrowseForeigners.php b/libraries/classes/BrowseForeigners.php index dad21d2d19..6b1d5dbdb8 100644 --- a/libraries/classes/BrowseForeigners.php +++ b/libraries/classes/BrowseForeigners.php @@ -146,7 +146,11 @@ class BrowseForeigners $output .= ''; - return [$output, $horizontal_count, $indexByDescription]; + return [ + $output, + $horizontal_count, + $indexByDescription, + ]; } /** @@ -295,7 +299,10 @@ class BrowseForeigners . '...' ); } - return [$description, $descriptionTitle]; + return [ + $description, + $descriptionTitle, + ]; } /** diff --git a/libraries/classes/CentralColumns.php b/libraries/classes/CentralColumns.php index 7643d47303..ef9d2a8251 100644 --- a/libraries/classes/CentralColumns.php +++ b/libraries/classes/CentralColumns.php @@ -265,7 +265,7 @@ class CentralColumns $attribute = ""; if (isset($def['Type'])) { $extracted_columnspec = Util::extractColumnSpec($def['Type']); - $attribute = trim($extracted_columnspec[ 'attribute']); + $attribute = trim($extracted_columnspec['attribute']); $type = $extracted_columnspec['type']; $length = $extracted_columnspec['spec_in_brackets']; } @@ -760,10 +760,10 @@ class CentralColumns 'ci' => 0, 'ci_offset' => 0, 'column_meta' => [ - 'Field' => $row['col_name'] + 'Field' => $row['col_name'], ], 'cfg_relation' => [ - 'centralcolumnswork' => false + 'centralcolumnswork' => false, ], 'max_rows' => $this->maxRows, ]) @@ -1004,8 +1004,14 @@ class CentralColumns { $html = '
'; $header_cells = [ - __('Name'), __('Type'), __('Length/Values'), __('Default'), - __('Collation'), __('Attributes'), __('Null'), __('A_I') + __('Name'), + __('Type'), + __('Length/Values'), + __('Default'), + __('Collation'), + __('Attributes'), + __('Null'), + __('A_I'), ]; $html .= $this->getEditTableHeader($header_cells); $selected_fld_safe = []; diff --git a/libraries/classes/CheckUserPrivileges.php b/libraries/classes/CheckUserPrivileges.php index 36f564309d..1c0d6fd529 100644 --- a/libraries/classes/CheckUserPrivileges.php +++ b/libraries/classes/CheckUserPrivileges.php @@ -82,7 +82,7 @@ class CheckUserPrivileges return [ $show_grants_str, $show_grants_dbname, - $show_grants_tblname + $show_grants_tblname, ]; } diff --git a/libraries/classes/Config.php b/libraries/classes/Config.php index 23fc6fb358..38c1bf7354 100644 --- a/libraries/classes/Config.php +++ b/libraries/classes/Config.php @@ -711,8 +711,16 @@ class Config } if ($commit !== false) { - $author = ['name' => '', 'email' => '', 'date' => '']; - $committer = ['name' => '', 'email' => '', 'date' => '']; + $author = [ + 'name' => '', + 'email' => '', + 'date' => '' + ]; + $committer = [ + 'name' => '', + 'email' => '', + 'date' => '' + ]; do { $dataline = array_shift($commit); @@ -1414,7 +1422,7 @@ class Config 'PMA_IS_GD2', 'PMA_USR_OS', 'PMA_USR_BROWSER_VER', - 'PMA_USR_BROWSER_AGENT' + 'PMA_USR_BROWSER_AGENT', ]; foreach ($defines as $define) { diff --git a/libraries/classes/Config/Descriptions.php b/libraries/classes/Config/Descriptions.php index e441ae8838..da7d106476 100644 --- a/libraries/classes/Config/Descriptions.php +++ b/libraries/classes/Config/Descriptions.php @@ -31,8 +31,14 @@ class Descriptions public static function get($path, $type = 'name') { $key = str_replace( - ['Servers/1/', '/'], - ['Servers/', '_'], + [ + 'Servers/1/', + '/', + ], + [ + 'Servers/', + '_', + ], $path ); $value = self::getString($key, $type); diff --git a/libraries/classes/Config/FormDisplay.php b/libraries/classes/Config/FormDisplay.php index 44bbac1ae5..126a562c31 100644 --- a/libraries/classes/Config/FormDisplay.php +++ b/libraries/classes/Config/FormDisplay.php @@ -860,9 +860,18 @@ class FormDisplay ) { $comment = ''; $funcs = [ - 'ZipDump' => ['zip_open', 'gzcompress'], - 'GZipDump' => ['gzopen', 'gzencode'], - 'BZipDump' => ['bzopen', 'bzcompress'] + 'ZipDump' => [ + 'zip_open', + 'gzcompress', + ], + 'GZipDump' => [ + 'gzopen', + 'gzencode', + ], + 'BZipDump' => [ + 'bzopen', + 'bzcompress', + ], ]; if (! function_exists($funcs[$systemPath][0])) { $comment = sprintf( diff --git a/libraries/classes/Config/FormDisplayTemplate.php b/libraries/classes/Config/FormDisplayTemplate.php index 11c9671d9c..08a4ed2561 100644 --- a/libraries/classes/Config/FormDisplayTemplate.php +++ b/libraries/classes/Config/FormDisplayTemplate.php @@ -193,10 +193,22 @@ class FormDisplayTemplate // The first element contains the filename and the second // element is used for the "alt" and "title" attributes. $iconInit = [ - 'edit' => ['b_edit', ''], - 'help' => ['b_help', __('Documentation')], - 'reload' => ['s_reload', ''], - 'tblops' => ['b_tblops', ''] + 'edit' => [ + 'b_edit', + '', + ], + 'help' => [ + 'b_help', + __('Documentation'), + ], + 'reload' => [ + 's_reload', + '', + ], + 'tblops' => [ + 'b_tblops', + '', + ], ]; if ($isSetupScript) { // When called from the setup script, we don't have access to the diff --git a/libraries/classes/Config/Forms/Page/BrowseForm.php b/libraries/classes/Config/Forms/Page/BrowseForm.php index b4c41da030..eee578aa1a 100644 --- a/libraries/classes/Config/Forms/Page/BrowseForm.php +++ b/libraries/classes/Config/Forms/Page/BrowseForm.php @@ -24,7 +24,7 @@ class BrowseForm extends BaseForm public static function getForms() { return [ - 'Browse' => MainForm::getForms()['Browse'] + 'Browse' => MainForm::getForms()['Browse'], ]; } } diff --git a/libraries/classes/Config/Forms/Page/DbStructureForm.php b/libraries/classes/Config/Forms/Page/DbStructureForm.php index dd82b70726..4f9a8e4979 100644 --- a/libraries/classes/Config/Forms/Page/DbStructureForm.php +++ b/libraries/classes/Config/Forms/Page/DbStructureForm.php @@ -24,7 +24,7 @@ class DbStructureForm extends BaseForm public static function getForms() { return [ - 'DbStructure' => MainForm::getForms()['DbStructure'] + 'DbStructure' => MainForm::getForms()['DbStructure'], ]; } } diff --git a/libraries/classes/Config/Forms/Page/TableStructureForm.php b/libraries/classes/Config/Forms/Page/TableStructureForm.php index 80a59fa7a8..05af06458c 100644 --- a/libraries/classes/Config/Forms/Page/TableStructureForm.php +++ b/libraries/classes/Config/Forms/Page/TableStructureForm.php @@ -24,7 +24,7 @@ class TableStructureForm extends BaseForm public static function getForms() { return [ - 'TableStructure' => MainForm::getForms()['TableStructure'] + 'TableStructure' => MainForm::getForms()['TableStructure'], ]; } } diff --git a/libraries/classes/Config/Forms/Setup/ConfigForm.php b/libraries/classes/Config/Forms/Setup/ConfigForm.php index f5c14647d3..6fd451583e 100644 --- a/libraries/classes/Config/Forms/Setup/ConfigForm.php +++ b/libraries/classes/Config/Forms/Setup/ConfigForm.php @@ -25,7 +25,7 @@ class ConfigForm extends BaseForm return [ 'Config' => [ 'DefaultLang', - 'ServerDefault' + 'ServerDefault', ], ]; } diff --git a/libraries/classes/Config/Forms/Setup/FeaturesForm.php b/libraries/classes/Config/Forms/Setup/FeaturesForm.php index 325cc3efc1..49631dcc33 100644 --- a/libraries/classes/Config/Forms/Setup/FeaturesForm.php +++ b/libraries/classes/Config/Forms/Setup/FeaturesForm.php @@ -24,7 +24,10 @@ class FeaturesForm extends \PhpMyAdmin\Config\Forms\User\FeaturesForm /* Remove only_db/hide_db, we have proper Server form in setup */ $result['Databases'] = array_diff( $result['Databases'], - ['Servers/1/only_db', 'Servers/1/hide_db'] + [ + 'Servers/1/only_db', + 'Servers/1/hide_db', + ] ); /* Following are not available to user */ $result['Import_export'] = [ @@ -49,7 +52,7 @@ class FeaturesForm extends \PhpMyAdmin\Config\Forms\User\FeaturesForm 'LoginCookieStore', 'LoginCookieDeleteAll', 'CaptchaLoginPublicKey', - 'CaptchaLoginPrivateKey' + 'CaptchaLoginPrivateKey', ]; $result['Developer'] = [ 'UserprefsDeveloperTab', diff --git a/libraries/classes/Config/Forms/Setup/ServersForm.php b/libraries/classes/Config/Forms/Setup/ServersForm.php index a394fd43a1..60899c6a7c 100644 --- a/libraries/classes/Config/Forms/Setup/ServersForm.php +++ b/libraries/classes/Config/Forms/Setup/ServersForm.php @@ -31,9 +31,9 @@ class ServersForm extends BaseForm 'port', 'socket', 'ssl', - 'compress' - ] - ] + 'compress', + ], + ], ], 'Server_auth' => [ 'Servers' => [ @@ -49,9 +49,9 @@ class ServersForm extends BaseForm ':group:' . __('Signon authentication'), 'SignonSession', 'SignonURL', - 'LogoutURL' - ] - ] + 'LogoutURL', + ], + ], ], 'Server_config' => [ 'Servers' => [ @@ -63,9 +63,9 @@ class ServersForm extends BaseForm 'DisableIS', 'AllowDeny/order', 'AllowDeny/rules', - 'SessionTimeZone' - ] - ] + 'SessionTimeZone', + ], + ], ], 'Server_pmadb' => [ 'Servers' => [ @@ -95,8 +95,8 @@ class ServersForm extends BaseForm 'designer_settings' => 'pma__designer_settings', 'export_templates' => 'pma__export_templates', 'MaxTableUiprefs' => 100 - ] - ] + ], + ], ], 'Server_tracking' => [ 'Servers' => [ @@ -106,8 +106,8 @@ class ServersForm extends BaseForm 'tracking_add_drop_view', 'tracking_add_drop_table', 'tracking_add_drop_database', - ] - ] + ], + ], ], ]; } diff --git a/libraries/classes/Config/Forms/User/ExportForm.php b/libraries/classes/Config/Forms/User/ExportForm.php index d2897133eb..5c7bf15a66 100644 --- a/libraries/classes/Config/Forms/User/ExportForm.php +++ b/libraries/classes/Config/Forms/User/ExportForm.php @@ -97,7 +97,7 @@ class ExportForm extends BaseForm 'Export/excel_null', 'Export/excel_removeCRLF', 'Export/excel_columns', - 'Export/excel_edition' + 'Export/excel_edition', ], 'Latex' => [ 'Export/latex_caption', @@ -115,13 +115,13 @@ class ExportForm extends BaseForm 'Export/latex_data_caption', 'Export/latex_data_continued_caption', 'Export/latex_data_label', - 'Export/latex_null' + 'Export/latex_null', ], 'Microsoft_Office' => [ ':group:' . __('Microsoft Word 2000'), 'Export/htmlword_structure_or_data', 'Export/htmlword_null', - 'Export/htmlword_columns' + 'Export/htmlword_columns', ], 'Open_Document' => [ ':group:' . __('OpenDocument Spreadsheet'), @@ -137,13 +137,13 @@ class ExportForm extends BaseForm ':group:end', ':group:' . __('Data'), 'Export/odt_columns', - 'Export/odt_null' + 'Export/odt_null', ], 'Texy' => [ 'Export/texytext_structure_or_data', ':group:' . __('Data'), 'Export/texytext_null', - 'Export/texytext_columns' + 'Export/texytext_columns', ], ]; } diff --git a/libraries/classes/Config/Forms/User/FeaturesForm.php b/libraries/classes/Config/Forms/User/FeaturesForm.php index a7a671aad6..ce5c074272 100644 --- a/libraries/classes/Config/Forms/User/FeaturesForm.php +++ b/libraries/classes/Config/Forms/User/FeaturesForm.php @@ -49,19 +49,19 @@ class FeaturesForm extends BaseForm 'CharTextareaRows', 'TextareaCols', 'TextareaRows', - 'LongtextDoubleTextarea' + 'LongtextDoubleTextarea', ], 'Page_titles' => [ 'TitleDefault', 'TitleTable', 'TitleDatabase', - 'TitleServer' + 'TitleServer', ], 'Warnings' => [ 'PmaNoRelation_DisableWarning', 'SuhosinDisableWarning', 'LoginCookieValidityDisableWarning', - 'ReservedWordDisableWarning' + 'ReservedWordDisableWarning', ], 'Console' => [ 'Console/Mode', diff --git a/libraries/classes/Config/Forms/User/ImportForm.php b/libraries/classes/Config/Forms/User/ImportForm.php index 81351f31f6..c447567261 100644 --- a/libraries/classes/Config/Forms/User/ImportForm.php +++ b/libraries/classes/Config/Forms/User/ImportForm.php @@ -28,12 +28,12 @@ class ImportForm extends BaseForm 'Import/charset', 'Import/allow_interrupt', 'Import/skip_queries', - 'enable_drag_drop_import' + 'enable_drag_drop_import', ], 'Sql' => [ 'Import/sql_compatibility', 'Import/sql_no_auto_value_on_zero', - 'Import/sql_read_as_multibytes' + 'Import/sql_read_as_multibytes', ], 'Csv' => [ ':group:' . __('CSV'), @@ -50,14 +50,14 @@ class ImportForm extends BaseForm 'Import/ldi_terminated', 'Import/ldi_enclosed', 'Import/ldi_escaped', - 'Import/ldi_local_option' + 'Import/ldi_local_option', ], 'Open_Document' => [ ':group:' . __('OpenDocument Spreadsheet'), 'Import/ods_col_names', 'Import/ods_empty_rows', 'Import/ods_recognize_percentages', - 'Import/ods_recognize_currency' + 'Import/ods_recognize_currency', ], ]; diff --git a/libraries/classes/Config/Forms/User/MainForm.php b/libraries/classes/Config/Forms/User/MainForm.php index de6f3949d3..cc323ac325 100644 --- a/libraries/classes/Config/Forms/User/MainForm.php +++ b/libraries/classes/Config/Forms/User/MainForm.php @@ -26,14 +26,14 @@ class MainForm extends BaseForm 'Startup' => [ 'ShowCreateDb', 'ShowStats', - 'ShowServerInfo' + 'ShowServerInfo', ], 'DbStructure' => [ 'ShowDbStructureCharset', 'ShowDbStructureComment', 'ShowDbStructureCreation', 'ShowDbStructureLastUpdate', - 'ShowDbStructureLastCheck' + 'ShowDbStructureLastCheck', ], 'TableStructure' => [ 'HideStructureActions', @@ -48,7 +48,7 @@ class MainForm extends BaseForm 'DefaultTransformations/Inline', 'DefaultTransformations/TextImageLink', 'DefaultTransformations/TextLink', - ':group:end' + ':group:end', ], 'Browse' => [ 'TableNavigationLinksMode', @@ -66,7 +66,7 @@ class MainForm extends BaseForm 'RowActionLinksWithoutUnique', 'TablePrimaryKeyOrder', 'RememberSorting', - 'RelationalDisplay' + 'RelationalDisplay', ], 'Edit' => [ 'ProtectBinary', @@ -74,13 +74,13 @@ class MainForm extends BaseForm 'ShowFieldTypesInDataEditView', 'InsertRows', 'ForeignKeyDropdownOrder', - 'ForeignKeyMaxLimit' + 'ForeignKeyMaxLimit', ], 'Tabs' => [ 'TabsMode', 'DefaultTabServer', 'DefaultTabDatabase', - 'DefaultTabTable' + 'DefaultTabTable', ], 'DisplayRelationalSchema' => [ 'PDFDefaultPageSize' diff --git a/libraries/classes/Config/Forms/User/NaviForm.php b/libraries/classes/Config/Forms/User/NaviForm.php index 864c99da91..e2d373c538 100644 --- a/libraries/classes/Config/Forms/User/NaviForm.php +++ b/libraries/classes/Config/Forms/User/NaviForm.php @@ -45,7 +45,7 @@ class NaviForm extends BaseForm 'NavigationTreeShowFunctions', 'NavigationTreeShowProcedures', 'NavigationTreeShowEvents', - 'NavigationTreeAutoexpandSingleDb' + 'NavigationTreeAutoexpandSingleDb', ], 'Navi_servers' => [ 'NavigationDisplayServers', @@ -53,7 +53,7 @@ class NaviForm extends BaseForm ], 'Navi_databases' => [ 'NavigationTreeDisplayDbFilterMinimum', - 'NavigationTreeDbSeparator' + 'NavigationTreeDbSeparator', ], 'Navi_tables' => [ 'NavigationTreeDefaultTabTable', diff --git a/libraries/classes/Config/PageSettings.php b/libraries/classes/Config/PageSettings.php index 5e258973e3..965b240ebb 100644 --- a/libraries/classes/Config/PageSettings.php +++ b/libraries/classes/Config/PageSettings.php @@ -173,7 +173,7 @@ class PageSettings false, $response->getFooter()->getSelfUrl(), [ - 'submit_save' => $this->_groupName + 'submit_save' => $this->_groupName, ] ); $retval .= ''; diff --git a/libraries/classes/Config/ServerConfigChecks.php b/libraries/classes/Config/ServerConfigChecks.php index 1657323736..cde0ccfba6 100644 --- a/libraries/classes/Config/ServerConfigChecks.php +++ b/libraries/classes/Config/ServerConfigChecks.php @@ -241,7 +241,11 @@ class ServerConfigChecks ); } } - return [$cookieAuthUsed, $blowfishSecret, $blowfishSecretSet]; + return [ + $cookieAuthUsed, + $blowfishSecret, + $blowfishSecretSet, + ]; } /** @@ -262,7 +266,10 @@ class ServerConfigChecks $blowfishSecretSet = true; $this->cfg->set('blowfish_secret', Util::generateRandom(32)); } - return [$blowfishSecret, $blowfishSecretSet]; + return [ + $blowfishSecret, + $blowfishSecretSet, + ]; } /** diff --git a/libraries/classes/Config/Validator.php b/libraries/classes/Config/Validator.php index 403a729d5c..833c1c46e8 100644 --- a/libraries/classes/Config/Validator.php +++ b/libraries/classes/Config/Validator.php @@ -318,7 +318,7 @@ class Validator $result = [ 'Server_pmadb' => '', 'Servers/1/controluser' => '', - 'Servers/1/controlpass' => '' + 'Servers/1/controlpass' => '', ]; $error = false; @@ -506,7 +506,7 @@ class Validator false, 65535, __('Not a valid port number!') - ) + ), ]; } @@ -528,7 +528,7 @@ class Validator false, PHP_INT_MAX, __('Not a positive number!') - ) + ), ]; } @@ -550,7 +550,7 @@ class Validator true, PHP_INT_MAX, __('Not a non-negative number!') - ) + ), ]; } @@ -589,7 +589,7 @@ class Validator $path => $result ? '' : sprintf( __('Value must be equal or lower than %s!'), $maxValue - ) + ), ]; } } diff --git a/libraries/classes/Controllers/Database/DatabaseStructureController.php b/libraries/classes/Controllers/Database/DatabaseStructureController.php index 40731b93e2..93865a077e 100644 --- a/libraries/classes/Controllers/Database/DatabaseStructureController.php +++ b/libraries/classes/Controllers/Database/DatabaseStructureController.php @@ -159,7 +159,7 @@ class DatabaseStructureController extends DatabaseController $uri = './db_structure.php' . Url::getCommonRaw([ 'db' => $this->db, 'pos' => max(0, $this->_total_num_tables - $GLOBALS['cfg']['MaxTableList']), - 'reload' => 1 + 'reload' => 1, ]); Core::sendHeaderLocation($uri); } @@ -187,7 +187,7 @@ class DatabaseStructureController extends DatabaseController $this->response->addHTML('
'); $_url_params = [ 'pos' => $this->_pos, - 'db' => $this->db + 'db' => $this->db, ]; // Add the sort options if they exists @@ -236,7 +236,7 @@ class DatabaseStructureController extends DatabaseController 'url_query' => Url::getCommon([ 'db' => $this->db, 'goto' => 'db_structure.php', - ]) + ]), ]) ); @@ -305,10 +305,11 @@ class DatabaseStructureController extends DatabaseController return; } // Check if current table is already in favorite list. - $favParams = ['db' => $this->db, + $favParams = [ + 'db' => $this->db, 'ajax_request' => true, 'favorite_table' => $favorite_table, - (($already_favorite ? 'remove' : 'add') . '_favorite') => true + (($already_favorite ? 'remove' : 'add') . '_favorite') => true, ]; $this->response->addJSON([ 'user' => $user, @@ -353,7 +354,7 @@ class DatabaseStructureController extends DatabaseController ->getRealRowCountTable(); $real_row_count_all[] = [ 'table' => $table['TABLE_NAME'], - 'row_count' => $row_count + 'row_count' => $row_count, ]; } @@ -440,7 +441,10 @@ class DatabaseStructureController extends DatabaseController $table_is_view = false; // Sets parameters for links $tbl_url_query = Url::getCommon( - ['db' => $this->db, 'table' => $current_table['TABLE_NAME']] + [ + 'db' => $this->db, + 'table' => $current_table['TABLE_NAME'], + ] ); // do not list the previous table's size info for a view @@ -789,7 +793,10 @@ class DatabaseStructureController extends DatabaseController } } - return [$approx_rows, $show_superscript]; + return [ + $approx_rows, + $show_superscript, + ]; } /** @@ -842,7 +849,10 @@ class DatabaseStructureController extends DatabaseController ); } - return [$do, $ignored]; + return [ + $do, + $ignored, + ]; } /** @@ -1017,8 +1027,15 @@ class DatabaseStructureController extends DatabaseController $table_is_view = true; } - return [$current_table, $formatted_size, $unit, $formatted_overhead, - $overhead_unit, $overhead_size, $table_is_view, $sum_size + return [ + $current_table, + $formatted_size, + $unit, + $formatted_overhead, + $overhead_unit, + $overhead_size, + $table_is_view, + $sum_size, ]; } @@ -1071,8 +1088,14 @@ class DatabaseStructureController extends DatabaseController $overhead_size += $current_table['Data_free']; } } - return [$current_table, $formatted_size, $unit, $formatted_overhead, - $overhead_unit, $overhead_size, $sum_size + return [ + $current_table, + $formatted_size, + $unit, + $formatted_overhead, + $overhead_unit, + $overhead_size, + $sum_size, ]; } @@ -1113,6 +1136,11 @@ class DatabaseStructureController extends DatabaseController ); } - return [$current_table, $formatted_size, $unit, $sum_size]; + return [ + $current_table, + $formatted_size, + $unit, + $sum_size, + ]; } } diff --git a/libraries/classes/Controllers/Server/ServerDatabasesController.php b/libraries/classes/Controllers/Server/ServerDatabasesController.php index f86b5e166e..041473dba4 100644 --- a/libraries/classes/Controllers/Server/ServerDatabasesController.php +++ b/libraries/classes/Controllers/Server/ServerDatabasesController.php @@ -262,7 +262,7 @@ class ServerDatabasesController extends Controller 'SCHEMA_DATA_LENGTH', 'SCHEMA_INDEX_LENGTH', 'SCHEMA_LENGTH', - 'SCHEMA_DATA_FREE' + 'SCHEMA_DATA_FREE', ]; if (in_array($_REQUEST['sort_by'], $sort_by_whitelist)) { $this->_sort_by = $_REQUEST['sort_by']; @@ -360,7 +360,10 @@ class ServerDatabasesController extends Controller $column_order = []; $column_order['DEFAULT_COLLATION_NAME'] = [ 'disp_name' => __('Collation'), - 'description_function' => [Charsets::class, 'getCollationDescr'], + 'description_function' => [ + Charsets::class, + 'getCollationDescr', + ], 'format' => 'string', 'footer' => '', ]; diff --git a/libraries/classes/Controllers/Server/ServerVariablesController.php b/libraries/classes/Controllers/Server/ServerVariablesController.php index 0f3e56b5cc..eff45d25df 100644 --- a/libraries/classes/Controllers/Server/ServerVariablesController.php +++ b/libraries/classes/Controllers/Server/ServerVariablesController.php @@ -185,7 +185,7 @@ class ServerVariablesController extends Controller 'mb' => 2, 'mib' => 2, 'gb' => 3, - 'gib' => 3 + 'gib' => 3, ]; $value = floatval($matches[1]) * pow( 1024, @@ -275,7 +275,7 @@ class ServerVariablesController extends Controller return [ $formattedValue, - $isHtmlFormatted + $isHtmlFormatted, ]; } @@ -369,7 +369,7 @@ class ServerVariablesController extends Controller 'is_html_formatted' => $isHtmlFormatted, 'has_session_value' => $has_session_value, 'session_value' => isset($sessionFormattedValue)?$sessionFormattedValue:null, - 'session_is_html_formated' => isset($sessionIsHtmlFormatted)?$sessionIsHtmlFormatted:null + 'session_is_html_formated' => isset($sessionIsHtmlFormatted)?$sessionIsHtmlFormatted:null, ]); } diff --git a/libraries/classes/Controllers/Table/TableChartController.php b/libraries/classes/Controllers/Table/TableChartController.php index faabf96be2..39c638a7e4 100644 --- a/libraries/classes/Controllers/Table/TableChartController.php +++ b/libraries/classes/Controllers/Table/TableChartController.php @@ -105,7 +105,7 @@ class TableChartController extends TableController 'vendor/jqplot/plugins/jqplot.pointLabels.js', 'vendor/jqplot/plugins/jqplot.pieRenderer.js', 'vendor/jqplot/plugins/jqplot.enhancedPieLegendRenderer.js', - 'vendor/jqplot/plugins/jqplot.highlighter.js' + 'vendor/jqplot/plugins/jqplot.highlighter.js', ] ); @@ -154,7 +154,10 @@ class TableChartController extends TableController $keys = array_keys($data[0]); - $numeric_types = ['int', 'real']; + $numeric_types = [ + 'int', + 'real', + ]; $numeric_column_count = 0; foreach ($keys as $idx => $key) { if (in_array($fields_meta[$idx]->type, $numeric_types)) { diff --git a/libraries/classes/Controllers/Table/TableRelationController.php b/libraries/classes/Controllers/Table/TableRelationController.php index f127a9d4ba..51c668c8c9 100644 --- a/libraries/classes/Controllers/Table/TableRelationController.php +++ b/libraries/classes/Controllers/Table/TableRelationController.php @@ -120,7 +120,7 @@ class TableRelationController extends TableController $this->response->getHeader()->getScripts()->addFiles( [ 'tbl_relation.js', - 'indexes.js' + 'indexes.js', ] ); diff --git a/libraries/classes/Controllers/Table/TableSearchController.php b/libraries/classes/Controllers/Table/TableSearchController.php index 09a95131a8..366b65698a 100644 --- a/libraries/classes/Controllers/Table/TableSearchController.php +++ b/libraries/classes/Controllers/Table/TableSearchController.php @@ -373,7 +373,7 @@ class TableSearchController extends TableController 'Browse' => Util::getIcon( 'b_browse', __('Browse foreign values') - ) + ), ]; $column_names_hashes = []; @@ -724,7 +724,18 @@ class TableSearchController extends TableController if (is_array($result)) { /* Iterate over possible delimiters to get one */ - $delimiters = ['/', '@', '#', '~', '!', '$', '%', '^', '&', '_']; + $delimiters = [ + '/', + '@', + '#', + '~', + '!', + '$', + '%', + '^', + '&', + '_', + ]; $found = false; for ($i = 0, $l = count($delimiters); $i < $l; $i++) { if (strpos($find, $delimiters[$i]) === false) { @@ -916,7 +927,7 @@ class TableSearchController extends TableController 'Browse' => Util::getIcon( 'b_browse', __('Browse foreign values') - ) + ), ]; //Gets column's type and collation $type = $this->_columnTypes[$column_index]; diff --git a/libraries/classes/Controllers/Table/TableStructureController.php b/libraries/classes/Controllers/Table/TableStructureController.php index a27b89df99..3d4b246630 100644 --- a/libraries/classes/Controllers/Table/TableStructureController.php +++ b/libraries/classes/Controllers/Table/TableStructureController.php @@ -156,7 +156,7 @@ class TableStructureController extends TableController $this->response->getHeader()->getScripts()->addFiles( [ 'tbl_structure.js', - 'indexes.js' + 'indexes.js', ] ); @@ -431,7 +431,10 @@ class TableStructureController extends TableController } $virtual = [ - 'VIRTUAL', 'PERSISTENT', 'VIRTUAL GENERATED', 'STORED GENERATED' + 'VIRTUAL', + 'PERSISTENT', + 'VIRTUAL GENERATED', + 'STORED GENERATED', ]; $data['Virtuality'] = ''; $data['Expression'] = ''; @@ -483,7 +486,7 @@ class TableStructureController extends TableController $this->response->addJSON( 'sql_data', $this->template->render('preview_sql', [ - 'query_data' => $sql_query + 'query_data' => $sql_query, ]) ); } else { // move column @@ -779,9 +782,14 @@ class TableStructureController extends TableController protected function getMultipleFieldCommandType() { $types = [ - 'change', 'drop', 'primary', - 'index', 'unique', 'spatial', - 'fulltext', 'browse' + 'change', + 'drop', + 'primary', + 'index', + 'unique', + 'spatial', + 'fulltext', + 'browse', ]; foreach ($types as $type) { @@ -870,7 +878,8 @@ class TableStructureController extends TableController { $err_url = 'tbl_structure.php' . Url::getCommon( [ - 'db' => $this->db, 'table' => $this->table + 'db' => $this->db, + 'table' => $this->table, ] ); $regenerate = false; @@ -1173,9 +1182,15 @@ class TableStructureController extends TableController } $fields = [ - 'field_attribute', 'field_collation', 'field_comments', - 'field_default_value', 'field_default_type', 'field_extra', - 'field_length', 'field_null', 'field_type' + 'field_attribute', + 'field_collation', + 'field_comments', + 'field_default_value', + 'field_default_type', + 'field_extra', + 'field_length', + 'field_null', + 'field_type', ]; foreach ($fields as $field) { if ($_POST[$field][$i] != $_POST[$field . '_orig'][$i]) { @@ -1608,8 +1623,11 @@ class TableStructureController extends TableController } return [ - $what, $query_type, $is_unset_submit_mult, $mult_btn, - $centralColsError + $what, + $query_type, + $is_unset_submit_mult, + $mult_btn, + $centralColsError, ]; } } diff --git a/libraries/classes/Core.php b/libraries/classes/Core.php index 8a902ce8f1..2c115f78d6 100644 --- a/libraries/classes/Core.php +++ b/libraries/classes/Core.php @@ -314,7 +314,18 @@ class Core { /* List of PHP documentation translations */ $php_doc_languages = [ - 'pt_BR', 'zh', 'fr', 'de', 'it', 'ja', 'pl', 'ro', 'ru', 'fa', 'es', 'tr' + 'pt_BR', + 'zh', + 'fr', + 'de', + 'it', + 'ja', + 'pl', + 'ro', + 'ru', + 'fa', + 'es', + 'tr', ]; $lang = 'en'; @@ -778,7 +789,11 @@ class Core return false; } // We do not want these to be present - $blocked = ['user', 'pass', 'port']; + $blocked = [ + 'user', + 'pass', + 'port', + ]; foreach ($blocked as $part) { if (isset($arr[$part]) && strlen((string) $arr[$part]) != 0) { return false; @@ -795,14 +810,17 @@ class Core 'demo.phpmyadmin.net', 'docs.phpmyadmin.net', /* mysql.com domains */ - 'dev.mysql.com','bugs.mysql.com', + 'dev.mysql.com', + 'bugs.mysql.com', /* mariadb domains */ - 'mariadb.org', 'mariadb.com', + 'mariadb.org', + 'mariadb.com', /* php.net domains */ 'php.net', 'secure.php.net', /* Github domains*/ - 'github.com','www.github.com', + 'github.com', + 'www.github.com', /* Percona domains */ 'www.percona.com', /* Following are doubtful ones. */ diff --git a/libraries/classes/CreateAddField.php b/libraries/classes/CreateAddField.php index ef0c6021b6..230f8615d1 100644 --- a/libraries/classes/CreateAddField.php +++ b/libraries/classes/CreateAddField.php @@ -551,6 +551,9 @@ class CreateAddField if (isset($_POST['preview_sql'])) { Core::previewSQL($sqlQuery); } - return [$this->dbi->tryQuery($sqlQuery), $sqlQuery]; + return [ + $this->dbi->tryQuery($sqlQuery), + $sqlQuery, + ]; } } diff --git a/libraries/classes/Database/Designer/Common.php b/libraries/classes/Database/Designer/Common.php index 837a1131d3..64b32a4f8d 100644 --- a/libraries/classes/Database/Designer/Common.php +++ b/libraries/classes/Database/Designer/Common.php @@ -209,7 +209,7 @@ class Common $retval[$ti][$c_name_i][$dtn_i] = []; $retval[$ti][$c_name_i][$dtn_i][$con['DCN'][$i]] = [ 0 => $con['STN'][$i], - 1 => $con['SCN'][$i] + 1 => $con['SCN'][$i], ]; } $ti++; @@ -263,7 +263,7 @@ class Common { $retval = [ 'j_tabs' => [], - 'h_tabs' => [] + 'h_tabs' => [], ]; for ($i = 0, $cnt = count($GLOBALS['designer']['TABLE_NAME']); $i < $cnt; $i++) { @@ -587,7 +587,10 @@ class Common if ($foreigner && isset($foreigner['constraint']) ) { - return [false, __('Error: relationship already exists.')]; + return [ + false, + __('Error: relationship already exists.'), + ]; } // note: in InnoDB, the index does not requires to be on a PRIMARY // or UNIQUE key @@ -633,23 +636,32 @@ class Common } $upd_query .= ';'; if ($this->dbi->tryQuery($upd_query)) { - return [true, __('FOREIGN KEY relationship has been added.')]; + return [ + true, + __('FOREIGN KEY relationship has been added.'), + ]; } $error = $this->dbi->getError(); return [ false, __('Error: FOREIGN KEY relationship could not be added!') - . "
" . $error + . "
" . $error, ]; } - return [false, __('Error: Missing index on column(s).')]; + return [ + false, + __('Error: Missing index on column(s).'), + ]; } // internal (pmadb) relation if ($GLOBALS['cfgRelation']['relwork'] == false) { - return [false, __('Error: Relational features are disabled!')]; + return [ + false, + __('Error: Relational features are disabled!'), + ]; } // no need to recheck if the keys are primary or unique at this point, @@ -671,14 +683,17 @@ class Common if ($this->relation->queryAsControlUser($q, false, DatabaseInterface::QUERY_STORE) ) { - return [true, __('Internal relationship has been added.')]; + return [ + true, + __('Internal relationship has been added.'), + ]; } $error = $this->dbi->getError(DatabaseInterface::CONNECT_CONTROL); return [ false, __('Error: Internal relationship could not be added!') - . "
" . $error + . "
" . $error, ]; } @@ -715,14 +730,17 @@ class Common . '.' . Util::backquote($T2) . ' DROP FOREIGN KEY ' . Util::backquote($foreigner['constraint']) . ';'; if ($this->dbi->query($upd_query)) { - return [true, __('FOREIGN KEY relationship has been removed.')]; + return [ + true, + __('FOREIGN KEY relationship has been removed.'), + ]; } $error = $this->dbi->getError(); return [ false, __('Error: FOREIGN KEY relationship could not be removed!') - . "
" . $error + . "
" . $error, ]; } } @@ -748,11 +766,14 @@ class Common $error = $this->dbi->getError(DatabaseInterface::CONNECT_CONTROL); return [ false, - __('Error: Internal relationship could not be removed!') . "
" . $error + __('Error: Internal relationship could not be removed!') . "
" . $error, ]; } - return [true, __('Internal relationship has been removed.')]; + return [ + true, + __('Internal relationship has been removed.'), + ]; } /** @@ -769,7 +790,7 @@ class Common $cfgDesigner = [ 'user' => $GLOBALS['cfg']['Server']['user'], 'db' => $cfgRelation['db'], - 'table' => $cfgRelation['designer_settings'] + 'table' => $cfgRelation['designer_settings'], ]; $success = true; diff --git a/libraries/classes/Database/Qbe.php b/libraries/classes/Database/Qbe.php index 98099f9fde..621248e32f 100644 --- a/libraries/classes/Database/Qbe.php +++ b/libraries/classes/Database/Qbe.php @@ -1496,7 +1496,7 @@ class Qbe } // end for return [ 'where_clause_tables' => $where_clause_tables, - 'where_clause_columns' => $where_clause_columns + 'where_clause_columns' => $where_clause_columns, ]; } @@ -1958,19 +1958,31 @@ class Qbe if (isset($unique_columns) && count($unique_columns) > 0) { $candidate_columns = $unique_columns; $needsort = 1; - return [$candidate_columns, $needsort]; + return [ + $candidate_columns, + $needsort, + ]; } elseif (isset($index_columns) && count($index_columns) > 0) { $candidate_columns = $index_columns; $needsort = 1; - return [$candidate_columns, $needsort]; + return [ + $candidate_columns, + $needsort, + ]; } elseif (isset($where_clause_columns) && count($where_clause_columns) > 0) { $candidate_columns = $where_clause_columns; $needsort = 0; - return [$candidate_columns, $needsort]; + return [ + $candidate_columns, + $needsort, + ]; } $candidate_columns = $search_tables; $needsort = 0; - return [$candidate_columns, $needsort]; + return [ + $candidate_columns, + $needsort, + ]; } } diff --git a/libraries/classes/Database/Search.php b/libraries/classes/Database/Search.php index 69396af444..6a5054f8a5 100644 --- a/libraries/classes/Database/Search.php +++ b/libraries/classes/Database/Search.php @@ -330,7 +330,7 @@ class Search ), '3' => $this->searchTypes[3], '4' => $this->searchTypes[4], - '5' => $this->searchTypes[5] . ' ' . Util::showMySQLDocu('Regexp') + '5' => $this->searchTypes[5] . ' ' . Util::showMySQLDocu('Regexp'), ]; return $this->template->render('database/search/main', [ 'db' => $this->db, diff --git a/libraries/classes/DatabaseInterface.php b/libraries/classes/DatabaseInterface.php index 071a6e976e..ebb9a24080 100644 --- a/libraries/classes/DatabaseInterface.php +++ b/libraries/classes/DatabaseInterface.php @@ -449,7 +449,10 @@ class DatabaseInterface . implode( '\', \'', array_map( - [$this, 'escapeString'], + [ + $this, + 'escapeString', + ], $table ) ) @@ -584,7 +587,10 @@ class DatabaseInterface // comparison (if we are looking for the db Aa we don't want // to find the db aa) $this_databases = array_map( - [$this, 'escapeString'], + [ + $this, + 'escapeString', + ], $databases ); @@ -599,7 +605,10 @@ class DatabaseInterface $tables = $this->fetchResult( $sql, - ['TABLE_SCHEMA', 'TABLE_NAME'], + [ + 'TABLE_SCHEMA', + 'TABLE_NAME', + ], null, $link ); @@ -652,7 +661,10 @@ class DatabaseInterface . implode( '\', \'', array_map( - [$this, 'escapeString'], + [ + $this, + 'escapeString', + ], $table, $link ) @@ -1027,7 +1039,10 @@ class DatabaseInterface $GLOBALS['callback_sort_by'] = $sort_by; usort( $databases, - [self::class, '_usortComparisonCallback'] + [ + self::class, + '_usortComparisonCallback', + ] ); unset($GLOBALS['callback_sort_order'], $GLOBALS['callback_sort_by']); @@ -1977,7 +1992,7 @@ class DatabaseInterface 'PROCEDURE' => 'Create Procedure', 'FUNCTION' => 'Create Function', 'EVENT' => 'Create Event', - 'VIEW' => 'Create View' + 'VIEW' => 'Create View', ]; $query = 'SHOW CREATE ' . $which . ' ' . Util::backquote($db) . '.' @@ -2019,7 +2034,7 @@ class DatabaseInterface . " FROM `information_schema`.`ROUTINES`" . " WHERE `ROUTINE_SCHEMA` " . Util::getCollateForIS() . " = '" . $GLOBALS['dbi']->escapeString($db) . "'"; - if (Core::isValid($which, ['FUNCTION','PROCEDURE'])) { + if (Core::isValid($which, ['FUNCTION', 'PROCEDURE'])) { $query .= " AND `ROUTINE_TYPE` = '" . $which . "'"; } if (! empty($name)) { @@ -2266,7 +2281,10 @@ class DatabaseInterface $error .= ' - ' . $error_message . ' (' . __('Details…') . ')'; } } else { @@ -2434,7 +2452,10 @@ class DatabaseInterface public function getSystemSchemas(): array { $schemas = [ - 'information_schema', 'performance_schema', 'mysql', 'sys' + 'information_schema', + 'performance_schema', + 'mysql', + 'sys', ]; $systemSchemas = []; foreach ($schemas as $schema) { @@ -2499,9 +2520,16 @@ class DatabaseInterface // Share the settings if the host is same if ($server['host'] == $cfg['Server']['host']) { $shared = [ - 'port', 'socket', 'compress', - 'ssl', 'ssl_key', 'ssl_cert', 'ssl_ca', - 'ssl_ca_path', 'ssl_ciphers', 'ssl_verify', + 'port', + 'socket', + 'compress', + 'ssl', + 'ssl_key', + 'ssl_cert', + 'ssl_ca', + 'ssl_ca_path', + 'ssl_ciphers', + 'ssl_verify', ]; foreach ($shared as $item) { if (isset($cfg['Server'][$item])) { @@ -2521,7 +2549,11 @@ class DatabaseInterface } } else { if (is_null($server)) { - return [null, null, null]; + return [ + null, + null, + null, + ]; } if (isset($server['user'])) { $user = $server['user']; @@ -2550,7 +2582,11 @@ class DatabaseInterface $server['compress'] = false; } - return [$user, $password, $server]; + return [ + $user, + $password, + $server, + ]; } /** diff --git a/libraries/classes/Dbi/DbiDummy.php b/libraries/classes/Dbi/DbiDummy.php index ea5492fd11..7fb3337492 100644 --- a/libraries/classes/Dbi/DbiDummy.php +++ b/libraries/classes/Dbi/DbiDummy.php @@ -474,14 +474,22 @@ class DbiDummy implements DbiExtension * Array of queries this "driver" supports */ $GLOBALS['dummy_queries'] = [ - ['query' => 'SELECT 1', 'result' => [['1']]], + [ + 'query' => 'SELECT 1', + 'result' => [['1']], + ], [ 'query' => 'SELECT CURRENT_USER();', 'result' => [['pma_test@localhost']], ], [ 'query' => "SHOW VARIABLES LIKE 'lower_case_table_names'", - 'result' => [['lower_case_table_names', '1']], + 'result' => [ + [ + 'lower_case_table_names', + '1', + ], + ], ], [ 'query' => 'SELECT 1 FROM mysql.user LIMIT 1', @@ -535,20 +543,62 @@ class DbiDummy implements DbiExtension . ' LIKE \'Innodb\\_buffer\\_pool\\_%\'' . ' OR Variable_name = \'Innodb_page_size\';', 'result' => [ - ['Innodb_buffer_pool_pages_data', 0], - ['Innodb_buffer_pool_pages_dirty', 0], - ['Innodb_buffer_pool_pages_flushed', 0], - ['Innodb_buffer_pool_pages_free', 0], - ['Innodb_buffer_pool_pages_misc', 0], - ['Innodb_buffer_pool_pages_total', 4096], - ['Innodb_buffer_pool_read_ahead_rnd', 0], - ['Innodb_buffer_pool_read_ahead', 0], - ['Innodb_buffer_pool_read_ahead_evicted', 0], - ['Innodb_buffer_pool_read_requests', 64], - ['Innodb_buffer_pool_reads', 32], - ['Innodb_buffer_pool_wait_free', 0], - ['Innodb_buffer_pool_write_requests', 64], - ['Innodb_page_size', 16384], + [ + 'Innodb_buffer_pool_pages_data', + 0, + ], + [ + 'Innodb_buffer_pool_pages_dirty', + 0, + ], + [ + 'Innodb_buffer_pool_pages_flushed', + 0, + ], + [ + 'Innodb_buffer_pool_pages_free', + 0, + ], + [ + 'Innodb_buffer_pool_pages_misc', + 0, + ], + [ + 'Innodb_buffer_pool_pages_total', + 4096, + ], + [ + 'Innodb_buffer_pool_read_ahead_rnd', + 0, + ], + [ + 'Innodb_buffer_pool_read_ahead', + 0, + ], + [ + 'Innodb_buffer_pool_read_ahead_evicted', + 0, + ], + [ + 'Innodb_buffer_pool_read_requests', + 64, + ], + [ + 'Innodb_buffer_pool_reads', + 32, + ], + [ + 'Innodb_buffer_pool_wait_free', + 0, + ], + [ + 'Innodb_buffer_pool_write_requests', + 64, + ], + [ + 'Innodb_page_size', + 16384, + ], ], ], [ @@ -570,13 +620,19 @@ class DbiDummy implements DbiExtension [ 'query' => 'SHOW GLOBAL VARIABLES LIKE \'innodb_file_per_table\';', 'result' => [ - ['innodb_file_per_table', 'OFF'], + [ + 'innodb_file_per_table', + 'OFF', + ], ], ], [ 'query' => 'SHOW GLOBAL VARIABLES LIKE \'innodb_file_format\';', 'result' => [ - ['innodb_file_format', 'Antelope'], + [ + 'innodb_file_format', + 'Antelope', + ], ], ], [ @@ -592,7 +648,10 @@ class DbiDummy implements DbiExtension [ 'query' => 'SHOW SESSION VARIABLES LIKE \'FOREIGN_KEY_CHECKS\';', 'result' => [ - ['foreign_key_checks', 'ON'], + [ + 'foreign_key_checks', + 'ON', + ], ], ], [ @@ -619,8 +678,22 @@ class DbiDummy implements DbiExtension 'Extra', ], 'result' => [ - ['i', 'int(11)', 'NO', 'PRI', 'NULL', 'auto_increment'], - ['o', 'int(11)', 'NO', 'MUL', 'NULL', ''], + [ + 'i', + 'int(11)', + 'NO', + 'PRI', + 'NULL', + 'auto_increment', + ], + [ + 'o', + 'int(11)', + 'NO', + 'MUL', + 'NULL', + '', + ], ], ], [ @@ -638,8 +711,22 @@ class DbiDummy implements DbiExtension 'Extra', ], 'result' => [ - ['i', 'int(11)', 'NO', 'PRI', 'NULL', 'auto_increment'], - ['o', 'int(11)', 'NO', 'MUL', 'NULL', ''], + [ + 'i', + 'int(11)', + 'NO', + 'PRI', + 'NULL', + 'auto_increment', + ], + [ + 'o', + 'int(11)', + 'NO', + 'MUL', + 'NULL', + '', + ], ], ], [ @@ -694,8 +781,14 @@ class DbiDummy implements DbiExtension 'Description', ], 'result' => [ - ['utf8', 'UTF-8 Unicode'], - ['latin1', 'cp1252 West European'], + [ + 'utf8', + 'UTF-8 Unicode', + ], + [ + 'latin1', + 'cp1252 West European', + ], ], ], [ @@ -708,9 +801,21 @@ class DbiDummy implements DbiExtension 'Default', ], 'result' => [ - ['utf8', 'utf8_general_ci','Yes'], - ['utf8', 'utf8_bin', ''], - ['latin1', 'latin1_swedish_ci', 'Yes'], + [ + 'utf8', + 'utf8_general_ci', + 'Yes', + ], + [ + 'utf8', + 'utf8_bin', + '', + ], + [ + 'latin1', + 'latin1_swedish_ci', + 'Yes', + ], ], ], [ @@ -737,8 +842,22 @@ class DbiDummy implements DbiExtension 'input_transformation_options', ], 'result' => [ - ['o', 'text/plain', 'sql', '', 'regex', '/pma/i'], - ['col', 't', 'o/p', '', 'i/p', ''], + [ + 'o', + 'text/plain', + 'sql', + '', + 'regex', + '/pma/i', + ], + [ + 'col', + 't', + 'o/p', + '', + 'i/p', + '', + ], ], ], [ @@ -1163,8 +1282,14 @@ class DbiDummy implements DbiExtension [ 'query' => "SHOW FULL TABLES FROM `default` WHERE `Table_type`='BASE TABLE'", 'result' => [ - ["test1", "BASE TABLE"], - ["test2", "BASE TABLE"], + [ + "test1", + "BASE TABLE", + ], + [ + "test2", + "BASE TABLE", + ], ], ], [ @@ -1207,28 +1332,28 @@ class DbiDummy implements DbiExtension [ 'query' => 'DELETE FROM `mysql`.`db` WHERE `host` = "" ' . 'AND `Db` = "" AND `User` = ""', - 'result' => true + 'result' => true, ], [ 'query' => 'DELETE FROM `mysql`.`columns_priv` WHERE ' . '`host` = "" AND `Db` = "" AND `User` = ""', - 'result' => true + 'result' => true, ], [ 'query' => 'DELETE FROM `mysql`.`tables_priv` WHERE ' . '`host` = "" AND `Db` = "" AND `User` = "" AND Table_name = ""', - 'result' => true + 'result' => true, ], [ 'query' => 'DELETE FROM `mysql`.`procs_priv` WHERE ' . '`host` = "" AND `Db` = "" AND `User` = "" AND `Routine_name` = "" ' . 'AND `Routine_type` = ""', - 'result' => true + 'result' => true, ], [ 'query' => 'SELECT `plugin` FROM `mysql`.`user` WHERE ' . '`User` = "pma_username" AND `Host` = "pma_hostname" LIMIT 1', - 'result' => [] + 'result' => [], ], [ 'query' => 'SELECT @@default_authentication_plugin', @@ -1363,7 +1488,7 @@ class DbiDummy implements DbiExtension '3844432963', 'row_format=REDUNDANT', 'Test comment for "table1" in \'pma_test\'', - ] + ], ], ], [ @@ -1410,7 +1535,7 @@ class DbiDummy implements DbiExtension '3844432963', 'row_format=REDUNDANT', 'Test comment for "table1" in \'pma_test\'', - ] + ], ], ], [ @@ -1420,7 +1545,7 @@ class DbiDummy implements DbiExtension 'BIN_NAME' => 'pma_test', 'DEFAULT_COLLATION_NAME' => 'utf8mb4_general_ci', 'SCHEMA_NAME' => 'pma_test', - ] + ], ], ], [ @@ -1489,7 +1614,7 @@ class DbiDummy implements DbiExtension 'COLUMN_NAME' => 'idtable2', 'REFERENCED_TABLE_NAME' => 'table1', 'REFERENCED_COLUMN_NAME' => 'idtable1', - ] + ], ], ], diff --git a/libraries/classes/Display/Export.php b/libraries/classes/Display/Export.php index 1851a15e4a..d25837c344 100644 --- a/libraries/classes/Display/Export.php +++ b/libraries/classes/Display/Export.php @@ -618,7 +618,10 @@ class Export // Empty row for javascript manipulations $result .= '' . $template->render([ - 'type' => '', 'name' => '', 'field' => 'aliases_new', 'value' => '' + 'type' => '', + 'name' => '', + 'field' => 'aliases_new', + 'value' => '', ]) . ''; return $result . ''; @@ -681,7 +684,7 @@ class Export 'libraries/classes/Plugins/Export/', [ 'export_type' => $exportType, - 'single_table' => isset($GLOBALS['single_table']) + 'single_table' => isset($GLOBALS['single_table']), ] ); diff --git a/libraries/classes/Display/ImportAjax.php b/libraries/classes/Display/ImportAjax.php index afaee5aea2..055bf7c686 100644 --- a/libraries/classes/Display/ImportAjax.php +++ b/libraries/classes/Display/ImportAjax.php @@ -48,7 +48,7 @@ class ImportAjax //"session", "progress", "apc", - "noplugin" + "noplugin", ]; // select available plugin @@ -63,7 +63,11 @@ class ImportAjax break; } } - return [$SESSION_KEY, $upload_id, $plugins]; + return [ + $SESSION_KEY, + $upload_id, + $plugins, + ]; } /** diff --git a/libraries/classes/Display/Results.php b/libraries/classes/Display/Results.php index 6d06da9c8d..195999ad95 100644 --- a/libraries/classes/Display/Results.php +++ b/libraries/classes/Display/Results.php @@ -268,51 +268,51 @@ class Results $json_highlighting_data = [ 'libraries/classes/Plugins/Transformations/Output/Text_Plain_Json.php', 'PhpMyAdmin\Plugins\Transformations\Output\Text_Plain_Json', - 'Text_Plain' + 'Text_Plain', ]; $sql_highlighting_data = [ 'libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php', 'PhpMyAdmin\Plugins\Transformations\Output\Text_Plain_Sql', - 'Text_Plain' + 'Text_Plain', ]; $blob_sql_highlighting_data = [ 'libraries/classes/Plugins/Transformations/Output/Text_Octetstream_Sql.php', 'PhpMyAdmin\Plugins\Transformations\Output\Text_Octetstream_Sql', - 'Text_Octetstream' + 'Text_Octetstream', ]; $link_data = [ 'libraries/classes/Plugins/Transformations/Text_Plain_Link.php', 'PhpMyAdmin\Plugins\Transformations\Text_Plain_Link', - 'Text_Plain' + 'Text_Plain', ]; $this->transformation_info = [ 'information_schema' => [ 'events' => [ - 'event_definition' => $sql_highlighting_data + 'event_definition' => $sql_highlighting_data, ], 'processlist' => [ - 'info' => $sql_highlighting_data + 'info' => $sql_highlighting_data, ], 'routines' => [ - 'routine_definition' => $sql_highlighting_data + 'routine_definition' => $sql_highlighting_data, ], 'triggers' => [ - 'action_statement' => $sql_highlighting_data + 'action_statement' => $sql_highlighting_data, ], 'views' => [ - 'view_definition' => $sql_highlighting_data + 'view_definition' => $sql_highlighting_data, ] ], 'mysql' => [ 'event' => [ 'body' => $blob_sql_highlighting_data, - 'body_utf8' => $blob_sql_highlighting_data + 'body_utf8' => $blob_sql_highlighting_data, ], 'general_log' => [ - 'argument' => $sql_highlighting_data + 'argument' => $sql_highlighting_data, ], 'help_category' => [ - 'url' => $link_data + 'url' => $link_data, ], 'help_topic' => [ 'example' => $sql_highlighting_data, @@ -325,7 +325,7 @@ class Results 'body_utf8' => $blob_sql_highlighting_data ], 'slow_log' => [ - 'sql_text' => $sql_highlighting_data + 'sql_text' => $sql_highlighting_data, ] ] ]; @@ -336,12 +336,12 @@ class Results $relDb = &$this->transformation_info[$cfgRelation['db']]; if (! empty($cfgRelation['history'])) { $relDb[$cfgRelation['history']] = [ - 'sqlquery' => $sql_highlighting_data + 'sqlquery' => $sql_highlighting_data, ]; } if (! empty($cfgRelation['bookmark'])) { $relDb[$cfgRelation['bookmark']] = [ - 'query' => $sql_highlighting_data + 'query' => $sql_highlighting_data, ]; } if (! empty($cfgRelation['tracking'])) { @@ -352,37 +352,37 @@ class Results } if (! empty($cfgRelation['favorite'])) { $relDb[$cfgRelation['favorite']] = [ - 'tables' => $json_highlighting_data + 'tables' => $json_highlighting_data, ]; } if (! empty($cfgRelation['recent'])) { $relDb[$cfgRelation['recent']] = [ - 'tables' => $json_highlighting_data + 'tables' => $json_highlighting_data, ]; } if (! empty($cfgRelation['savedsearches'])) { $relDb[$cfgRelation['savedsearches']] = [ - 'search_data' => $json_highlighting_data + 'search_data' => $json_highlighting_data, ]; } if (! empty($cfgRelation['designer_settings'])) { $relDb[$cfgRelation['designer_settings']] = [ - 'settings_data' => $json_highlighting_data + 'settings_data' => $json_highlighting_data, ]; } if (! empty($cfgRelation['table_uiprefs'])) { $relDb[$cfgRelation['table_uiprefs']] = [ - 'prefs' => $json_highlighting_data + 'prefs' => $json_highlighting_data, ]; } if (! empty($cfgRelation['userconfig'])) { $relDb[$cfgRelation['userconfig']] = [ - 'config_data' => $json_highlighting_data + 'config_data' => $json_highlighting_data, ]; } if (! empty($cfgRelation['export_templates'])) { $relDb[$cfgRelation['export_templates']] = [ - 'template_data' => $json_highlighting_data + 'template_data' => $json_highlighting_data, ]; } } @@ -703,7 +703,10 @@ class Results } } // end if (3) - return [$displayParts, $the_total]; + return [ + $displayParts, + $the_total, + ]; } // end of the 'setDisplayPartsAndTotal()' function @@ -845,7 +848,10 @@ class Results $table_navigation_html .= '' . ''; } - return [$table_navigation_html, $nbTotalPage]; + return [ + $table_navigation_html, + $nbTotalPage, + ]; } /** @@ -1165,7 +1171,7 @@ class Results '50' => 50, '100' => 100, '250' => 250, - '500' => 500 + '500' => 500, ]; return $this->template->render('display/results/additional_fields', [ @@ -1449,7 +1455,10 @@ class Results } } - return [$unsorted_sql_query, $drop_down_html]; + return [ + $unsorted_sql_query, + $drop_down_html, + ]; } // end of the '_getUnsortedSqlAndSortByKeyDropDown()' function /** @@ -1615,7 +1624,10 @@ class Results $this->__set('display_params', $display_params); - return [$colspan, $button_html]; + return [ + $colspan, + $button_html, + ]; } // end of the '_getFieldVisibilityParams()' function @@ -1781,7 +1793,7 @@ class Results 'table' => $this->__get('table'), 'sql_query' => $this->__get('sql_query'), 'goto' => $this->__get('goto'), - 'full_text_button' => 1 + 'full_text_button' => 1, ]; if ($_SESSION['tmpval']['pftext'] == self::DISPLAY_FULL_TEXT) { @@ -1960,7 +1972,10 @@ class Results $comments ); - return [$order_link, $sorted_header_html]; + return [ + $order_link, + $sorted_header_html, + ]; } // end of the '_getOrderLinkAndSortedHeaderHtml()' function /** @@ -2105,7 +2120,11 @@ class Results if (empty($order_img)) { $order_img = ''; } - return [$single_sort_order, $sort_order, $order_img]; + return [ + $single_sort_order, + $sort_order, + $order_img, + ]; } /** @@ -2209,27 +2228,42 @@ class Results $order_img = ' ' . Util::getImage( 's_desc', __('Descending'), - ['class' => "soimg", 'title' => ''] + [ + 'class' => "soimg", + 'title' => '', + ] ); $order_img .= ' ' . Util::getImage( 's_asc', __('Ascending'), - ['class' => "soimg hide", 'title' => ''] + [ + 'class' => "soimg hide", + 'title' => '', + ] ); } else { $sort_order .= ' DESC'; $order_img = ' ' . Util::getImage( 's_asc', __('Ascending'), - ['class' => "soimg", 'title' => ''] + [ + 'class' => "soimg", + 'title' => '', + ] ); $order_img .= ' ' . Util::getImage( 's_desc', __('Descending'), - ['class' => "soimg hide", 'title' => ''] + [ + 'class' => "soimg hide", + 'title' => '', + ] ); } - return [$sort_order, $order_img]; + return [ + $sort_order, + $order_img, + ]; } // end of the '_getSortingUrlParams()' function @@ -2254,7 +2288,7 @@ class Results $multi_order_url ) { $order_link_params = [ - 'class' => 'sortlink' + 'class' => 'sortlink', ]; $order_link_content = htmlspecialchars($fields_meta->name); @@ -3018,7 +3052,10 @@ class Results : false; // Wrap MIME-transformations. [MIME] - $default_function = [Core::class, 'mimeDefaultFunction']; // default_function + $default_function = [ + Core::class, + 'mimeDefaultFunction', + ]; // default_function $transformation_plugin = $default_function; $transform_options = []; @@ -3042,11 +3079,9 @@ class Results $transform_options = $this->transformations->getOptions( isset( - $mime_map[$orgFullColName] - ['transformation_options'] + $mime_map[$orgFullColName]['transformation_options'] ) - ? $mime_map[$orgFullColName] - ['transformation_options'] + ? $mime_map[$orgFullColName]['transformation_options'] : '' ); @@ -3069,10 +3104,8 @@ class Results && (trim($row[$i]) != '') && ! $_SESSION['tmpval']['hide_transformation'] ) { - include_once $this->transformation_info - [$dbLower][$tblLower][$nameLower][0]; - $transformation_plugin = new $this->transformation_info - [$dbLower][$tblLower][$nameLower][1](null); + include_once $this->transformation_info[$dbLower][$tblLower][$nameLower][0]; + $transformation_plugin = new $this->transformation_info[$dbLower][$tblLower][$nameLower][1](null); $transform_options = $this->transformations->getOptions( isset($mime_map[$orgFullColName]['transformation_options']) @@ -3083,9 +3116,7 @@ class Results $meta->mimetype = str_replace( '_', '/', - $this->transformation_info[$dbLower] - [mb_strtolower($meta->orgtable)] - [mb_strtolower($meta->orgname)][2] + $this->transformation_info[$dbLower][mb_strtolower($meta->orgtable)][mb_strtolower($meta->orgname)][2] ); } @@ -3104,7 +3135,7 @@ class Results $transform_options = [ 0 => $linking_url, - 2 => true + 2 => true, ]; $meta->mimetype = str_replace( @@ -3138,7 +3169,7 @@ class Results 'db' => $this->__get('db'), 'table' => $meta->orgtable, 'where_clause' => $whereClauseMap[$row_no][$meta->orgtable], - 'transform_key' => $meta->orgname + 'transform_key' => $meta->orgname, ]; if (! empty($sql_query)) { @@ -3240,10 +3271,7 @@ class Results { $linking_url_params = []; - $link_relations = $GLOBALS['special_schema_links'] - [mb_strtolower($this->__get('db'))] - [mb_strtolower($this->__get('table'))] - [$field_name]; + $link_relations = $GLOBALS['special_schema_links'][mb_strtolower($this->__get('db'))][mb_strtolower($this->__get('table'))][$field_name]; if (! is_array($link_relations['link_param'])) { $linking_url_params[$link_relations['link_param']] = $column_value; @@ -3380,7 +3408,10 @@ class Results $col_visib = false; } - return [$col_order, $col_visib]; + return [ + $col_order, + $col_visib, + ]; } // end of the '_getColumnParams()' function @@ -3478,7 +3509,13 @@ class Results $edit_anchor_class .= ' nonunique'; } - return [$edit_url, $copy_url, $edit_str, $copy_str, $edit_anchor_class]; + return [ + $edit_url, + $copy_url, + $edit_str, + $copy_str, + $edit_anchor_class, + ]; } // end of the '_getModifiedLinks()' function @@ -3566,7 +3603,11 @@ class Results $del_url = $del_str = $js_conf = null; } - return [$del_url, $del_str, $js_conf]; + return [ + $del_url, + $del_str, + $js_conf, + ]; } // end of the '_getDeleteAndKillLinks()' function @@ -4190,7 +4231,8 @@ class Results if (Core::isValid( $_REQUEST['pftext'], [ - self::DISPLAY_PARTIAL_TEXT, self::DISPLAY_FULL_TEXT + self::DISPLAY_PARTIAL_TEXT, + self::DISPLAY_FULL_TEXT, ] ) ) { @@ -4203,7 +4245,8 @@ class Results if (Core::isValid( $_REQUEST['relational_display'], [ - self::RELATIONAL_KEY, self::RELATIONAL_DISPLAY_COLUMN + self::RELATIONAL_KEY, + self::RELATIONAL_DISPLAY_COLUMN, ] ) ) { @@ -4219,8 +4262,9 @@ class Results if (Core::isValid( $_REQUEST['geoOption'], [ - self::GEOMETRY_DISP_WKT, self::GEOMETRY_DISP_WKB, - self::GEOMETRY_DISP_GEOM + self::GEOMETRY_DISP_WKT, + self::GEOMETRY_DISP_WKB, + self::GEOMETRY_DISP_GEOM, ] ) ) { @@ -4486,7 +4530,7 @@ class Results $this->__get('table'), $fields_meta[1]->name, '', - $this->__get('db') + $this->__get('db'), ]; } } // end if @@ -4585,7 +4629,10 @@ class Results } } - return [$pos_next, $pos_prev]; + return [ + $pos_next, + $pos_prev, + ]; } // end of the '_getOffsets()' function @@ -4645,7 +4692,10 @@ class Results $row = $GLOBALS['dbi']->fetchRow($dt_result); // initializing default arguments - $default_function = [Core::class, 'mimeDefaultFunction']; + $default_function = [ + Core::class, + 'mimeDefaultFunction', + ]; $transformation_plugin = $default_function; $transform_options = []; @@ -4859,7 +4909,7 @@ class Results $rel['foreign_table'], $rel['foreign_field'], $display_field, - $rel['foreign_db'] + $rel['foreign_db'], ]; } else { foreach ($rel as $key => $one_key) { @@ -4877,7 +4927,7 @@ class Results $display_field, isset($one_key['ref_db_name']) ? $one_key['ref_db_name'] - : $GLOBALS['db'] + : $GLOBALS['db'], ]; } } @@ -5964,6 +6014,10 @@ class Results $truncated = false; } - return [$truncated, $str, $original_length]; + return [ + $truncated, + $str, + $original_length, + ]; } } diff --git a/libraries/classes/Encoding.php b/libraries/classes/Encoding.php index 58454c143e..5b8c1358b3 100644 --- a/libraries/classes/Encoding.php +++ b/libraries/classes/Encoding.php @@ -67,10 +67,26 @@ class Encoding * @var array */ private static $_enginemap = [ - 'iconv' => ['iconv', self::ENGINE_ICONV, 'iconv'], - 'recode' => ['recode_string', self::ENGINE_RECODE, 'recode'], - 'mb' => ['mb_convert_encoding', self::ENGINE_MB, 'mbstring'], - 'none' => ['isset', self::ENGINE_NONE, ''], + 'iconv' => [ + 'iconv', + self::ENGINE_ICONV, + 'iconv', + ], + 'recode' => [ + 'recode_string', + self::ENGINE_RECODE, + 'recode', + ], + 'mb' => [ + 'mb_convert_encoding', + self::ENGINE_MB, + 'mbstring', + ], + 'none' => [ + 'isset', + self::ENGINE_NONE, + '', + ], ]; /** @@ -79,7 +95,9 @@ class Encoding * @var array */ private static $_engineorder = [ - 'iconv', 'mb', 'recode', + 'iconv', + 'mb', + 'recode', ]; /** diff --git a/libraries/classes/Error.php b/libraries/classes/Error.php index fb82bb17f6..799ab9c600 100644 --- a/libraries/classes/Error.php +++ b/libraries/classes/Error.php @@ -131,7 +131,12 @@ class Error extends Message { $result = []; - $members = ['line', 'function', 'class', 'type']; + $members = [ + 'line', + 'function', + 'class', + 'type', + ]; foreach ($backtrace as $idx => $step) { /* Create new backtrace entry */ @@ -415,7 +420,7 @@ class Error extends Message 'mysqli_connect', 'mysqli_real_connect', 'connect', - '_realConnect' + '_realConnect', ]; if (in_array($function, $include_functions)) { diff --git a/libraries/classes/ErrorReport.php b/libraries/classes/ErrorReport.php index b93351e359..2e3b2fec80 100644 --- a/libraries/classes/ErrorReport.php +++ b/libraries/classes/ErrorReport.php @@ -203,7 +203,10 @@ class ErrorReport } $uri = $scriptName . "?" . $query; - return [$uri, $scriptName]; + return [ + $uri, + $scriptName, + ]; } /** diff --git a/libraries/classes/Export.php b/libraries/classes/Export.php index 87b6171892..4dc91def5f 100644 --- a/libraries/classes/Export.php +++ b/libraries/classes/Export.php @@ -322,7 +322,10 @@ class Export $filename .= '.zip'; $mime_type = 'application/zip'; } - return [$filename, $mime_type]; + return [ + $filename, + $mime_type, + ]; } /** @@ -375,7 +378,11 @@ class Export ); $message->addParam($save_filename); } - return [$save_filename, $message, $file_handle]; + return [ + $save_filename, + $message, + $file_handle, + ]; } /** @@ -489,7 +496,10 @@ class Export $back_button .= 'db_export.php" data-post="' . Url::getCommon(['db' => $db], ''); } else { $back_button .= 'tbl_export.php" data-post="' . Url::getCommon( - ['db' => $db, 'table' => $table], + [ + 'db' => $db, + 'table' => $table, + ], '' ); } @@ -531,7 +541,11 @@ class Export . ''; - return [$title, $export]; + return [ + $title, + $export, + ]; } /** @@ -4587,7 +4675,7 @@ class Privileges } $rel_params = []; $url_params = [ - 'adduser' => 1 + 'adduser' => 1, ]; if (! empty($db)) { $url_params['dbname'] @@ -4602,7 +4690,7 @@ class Privileges return $this->template->render('server/privileges/add_user_fieldset', [ 'url_params' => $url_params, - 'rel_params' => $rel_params + 'rel_params' => $rel_params, ]); } @@ -5046,7 +5134,7 @@ class Privileges 'Select' => [], 'Insert' => [], 'Update' => [], - 'References' => [] + 'References' => [], ]; while ($row2 = $this->dbi->fetchAssoc($res2)) { @@ -5234,7 +5322,10 @@ class Privileges $message = Message::rawError($this->dbi->getError()); } } - return [$sql_query, $message]; + return [ + $sql_query, + $message, + ]; } /** diff --git a/libraries/classes/Server/Status/Data.php b/libraries/classes/Server/Status/Data.php index 5108052c1e..94e7e7a73e 100644 --- a/libraries/classes/Server/Status/Data.php +++ b/libraries/classes/Server/Status/Data.php @@ -310,7 +310,11 @@ class Data $sectionUsed['other'] = true; } } - return [$allocationMap, $sectionUsed, $used_queries]; + return [ + $allocationMap, + $sectionUsed, + $used_queries, + ]; } /** @@ -456,7 +460,7 @@ class Data [ 'name' => __('Advisor'), 'url' => 'server_status_advisor.php' - ] + ], ]; $retval = '