From ca3c5e17b041690d585794d4595f2e7250cdd589 Mon Sep 17 00:00:00 2001 From: charliewindred Date: Tue, 2 Jun 2020 16:05:12 +0100 Subject: [PATCH 1/8] Remove underscore prefix from method names Removed underscore from method names for PSR-12 compliance. Signed-off-by: charliewindred --- libraries/classes/Config.php | 14 +- libraries/classes/Config/FormDisplay.php | 42 ++-- libraries/classes/Config/PageSettings.php | 12 +- libraries/classes/Database/Qbe.php | 146 +++++------ libraries/classes/Footer.php | 18 +- .../classes/Gis/GisGeometryCollection.php | 14 +- libraries/classes/Gis/GisMultiPolygon.php | 8 +- libraries/classes/Gis/GisPolygon.php | 8 +- libraries/classes/Gis/GisVisualization.php | 56 ++--- libraries/classes/Header.php | 8 +- libraries/classes/Html/Generator.php | 4 +- libraries/classes/Index.php | 8 +- libraries/classes/Menu.php | 26 +- libraries/classes/OutputBuffering.php | 4 +- .../Plugins/Auth/AuthenticationCookie.php | 14 +- .../classes/Plugins/Export/ExportCodegen.php | 8 +- .../Plugins/Export/ExportMediawiki.php | 66 ++--- .../classes/Plugins/Export/ExportPdf.php | 24 +- .../classes/Plugins/Export/ExportSql.php | 232 +++++++++--------- .../classes/Plugins/Export/ExportXml.php | 22 +- .../classes/Plugins/Import/ImportCsv.php | 14 +- .../Plugins/Import/ImportMediawiki.php | 46 ++-- .../classes/Plugins/Import/ImportSql.php | 4 +- .../Plugins/Schema/Dia/DiaRelationSchema.php | 14 +- .../Plugins/Schema/Dia/RelationStatsDia.php | 6 +- .../Plugins/Schema/Eps/EpsRelationSchema.php | 14 +- .../Plugins/Schema/Eps/TableStatsEps.php | 8 +- .../Plugins/Schema/Pdf/PdfRelationSchema.php | 28 +-- .../Plugins/Schema/Pdf/TableStatsPdf.php | 8 +- .../classes/Plugins/Schema/RelationStats.php | 6 +- .../Plugins/Schema/Svg/SvgRelationSchema.php | 24 +- .../Plugins/Schema/Svg/TableStatsSvg.php | 8 +- libraries/classes/RecentFavoriteTable.php | 12 +- libraries/classes/Response.php | 10 +- libraries/classes/Scripts.php | 4 +- libraries/classes/Server/Status/Data.php | 20 +- libraries/classes/Server/SysInfo/SunOs.php | 18 +- .../classes/Server/SysInfo/WindowsNt.php | 8 +- libraries/classes/Setup/ConfigGenerator.php | 18 +- libraries/classes/Table.php | 12 +- libraries/classes/ThemeManager.php | 4 +- libraries/classes/Tracker.php | 28 +-- libraries/classes/Util.php | 4 +- test/classes/Database/DesignerTest.php | 8 +- test/classes/Gis/GisMultiPolygonTest.php | 8 +- test/classes/Gis/GisPolygonTest.php | 8 +- test/selenium/CreateDropDatabaseTest.php | 4 +- test/selenium/Database/EventsTest.php | 6 +- test/selenium/Database/OperationsTest.php | 8 +- test/selenium/Database/ProceduresTest.php | 12 +- test/selenium/Database/TriggersTest.php | 6 +- test/selenium/ExportTest.php | 8 +- test/selenium/ImportTest.php | 8 +- test/selenium/NormalizationTest.php | 4 +- test/selenium/ServerSettingsTest.php | 10 +- test/selenium/SqlQueryTest.php | 8 +- test/selenium/Table/CreateTest.php | 4 +- test/selenium/Table/InsertTest.php | 4 +- test/selenium/TrackingTest.php | 6 +- 59 files changed, 582 insertions(+), 582 deletions(-) diff --git a/libraries/classes/Config.php b/libraries/classes/Config.php index 39ec3b422481..4ce67e5ff57a 100644 --- a/libraries/classes/Config.php +++ b/libraries/classes/Config.php @@ -171,7 +171,7 @@ public function checkOutputCompression(): void * * @param string $user_agent the user agent */ - private function _setClientPlatform(string $user_agent): void + private function setClientPlatform(string $user_agent): void { if (mb_strstr($user_agent, 'Win')) { $this->set('PMA_USR_OS', 'Win'); @@ -203,7 +203,7 @@ public function checkClient(): void } // 1. Platform - $this->_setClientPlatform($HTTP_USER_AGENT); + $this->setClientPlatform($HTTP_USER_AGENT); // 2. browser and version // (must check everything else before Mozilla) @@ -500,7 +500,7 @@ static function ($key) { /** * Sets the connection collation */ - private function _setConnectionCollation(): void + private function setConnectionCollation(): void { $collation_connection = $this->get('DefaultConnectionCollation'); if (empty($collation_connection) @@ -617,7 +617,7 @@ public function loadUserPreferences(): void } // set connection collation - $this->_setConnectionCollation(); + $this->setConnectionCollation(); } /** @@ -1205,7 +1205,7 @@ public static function fatalErrorHandler(): void * @param string $filename File to check and render * @param string $id Div ID */ - private static function _renderCustom(string $filename, string $id): string + private static function renderCustom(string $filename, string $id): string { $retval = ''; if (@file_exists($filename)) { @@ -1224,7 +1224,7 @@ private static function _renderCustom(string $filename, string $id): string */ public static function renderFooter(): string { - return self::_renderCustom(CUSTOM_FOOTER_FILE, 'pma_footer'); + return self::renderCustom(CUSTOM_FOOTER_FILE, 'pma_footer'); } /** @@ -1232,7 +1232,7 @@ public static function renderFooter(): string */ public static function renderHeader(): string { - return self::_renderCustom(CUSTOM_HEADER_FILE, 'pma_header'); + return self::renderCustom(CUSTOM_HEADER_FILE, 'pma_header'); } /** diff --git a/libraries/classes/Config/FormDisplay.php b/libraries/classes/Config/FormDisplay.php index bc754d44ef13..dd5e20a0a991 100644 --- a/libraries/classes/Config/FormDisplay.php +++ b/libraries/classes/Config/FormDisplay.php @@ -196,7 +196,7 @@ public function process($allowPartialSave = true, $checkFormSubmit = true) * * @return void */ - private function _validate() + private function validate() { if ($this->_isValidated) { return; @@ -251,7 +251,7 @@ private function _validate() * * @return string */ - private function _displayForms( + private function displayForms( $showRestoreDefault, array &$jsDefault, array &$js, @@ -279,7 +279,7 @@ private function _displayForms( ? ! isset($this->_userprefsDisallow[$path]) : null; // display input - $htmlOutput .= $this->_displayFieldInput( + $htmlOutput .= $this->displayFieldInput( $form, $field, $path, @@ -349,14 +349,14 @@ public function getDisplay( } } if (! $isNewServer) { - $this->_validate(); + $this->validate(); } // user preferences - $this->_loadUserprefsInfo(); + $this->loadUserprefsInfo(); // display forms - $htmlOutput .= $this->_displayForms( + $htmlOutput .= $this->displayForms( $showRestoreDefault, $jsDefault, $js, @@ -404,7 +404,7 @@ public function getDisplay( * * @return string|null HTML for input field */ - private function _displayFieldInput( + private function displayFieldInput( Form $form, $field, $systemPath, @@ -500,7 +500,7 @@ private function _displayFieldInput( $v = $ip . ': ' . $v; } } - $this->_setComments($systemPath, $opts); + $this->setComments($systemPath, $opts); // send default value to form's JS $jsLine = '\'' . $translatedPath . '\': '; @@ -549,7 +549,7 @@ private function _displayFieldInput( */ public function displayErrors() { - $this->_validate(); + $this->validate(); if (count($this->_errors) === 0) { return null; } @@ -575,7 +575,7 @@ public function displayErrors() */ public function fixErrors() { - $this->_validate(); + $this->validate(); if (count($this->_errors) === 0) { return; } @@ -598,7 +598,7 @@ public function fixErrors() * * @return bool */ - private function _validateSelect(&$value, array $allowed): bool + private function validateSelect(&$value, array $allowed): bool { $valueCmp = is_bool($value) ? (int) $value @@ -643,7 +643,7 @@ public function save($forms, $allowPartialSave = true) $toSave = []; $isSetupScript = $GLOBALS['PMA_Config']->get('is_setup'); if ($isSetupScript) { - $this->_loadUserprefsInfo(); + $this->loadUserprefsInfo(); } $this->_errors = []; @@ -712,7 +712,7 @@ public function save($forms, $allowPartialSave = true) } break; case 'select': - $successfullyValidated = $this->_validateSelect( + $successfullyValidated = $this->validateSelect( $_POST[$key], $form->getOptionValueList($systemPath) ); @@ -733,7 +733,7 @@ public function save($forms, $allowPartialSave = true) ? $_POST[$key] : explode("\n", $_POST[$key]); $_POST[$key] = []; - $this->_fillPostArrayParameters($postValues, $key); + $this->fillPostArrayParameters($postValues, $key); break; } @@ -753,7 +753,7 @@ public function save($forms, $allowPartialSave = true) // save forms if (! $allowPartialSave && ! empty($this->_errors)) { // don't look for non-critical errors - $this->_validate(); + $this->validate(); return $result; } @@ -792,7 +792,7 @@ public function save($forms, $allowPartialSave = true) } // don't look for non-critical errors - $this->_validate(); + $this->validate(); return $result; } @@ -823,7 +823,7 @@ public function getDocLink($path) return MySQLDocumentation::getDocumentationLink( 'config', - 'cfg_' . $this->_getOptName($path), + 'cfg_' . $this->getOptName($path), Sanitize::isSetup() ? '../' : './' ); } @@ -835,7 +835,7 @@ public function getDocLink($path) * * @return string */ - private function _getOptName($path) + private function getOptName($path) { return str_replace(['Servers/1/', '/'], ['Servers/', '_'], $path); } @@ -845,7 +845,7 @@ private function _getOptName($path) * * @return void */ - private function _loadUserprefsInfo() + private function loadUserprefsInfo() { if ($this->_userprefsKeys !== null) { return; @@ -867,7 +867,7 @@ private function _loadUserprefsInfo() * * @return void */ - private function _setComments($systemPath, array &$opts) + private function setComments($systemPath, array &$opts) { // RecodingEngine - mark unavailable types if ($systemPath == 'RecodingEngine') { @@ -955,7 +955,7 @@ private function _setComments($systemPath, array &$opts) * * @return void */ - private function _fillPostArrayParameters(array $postValues, $key) + private function fillPostArrayParameters(array $postValues, $key) { foreach ($postValues as $v) { $v = Util::requestString($v); diff --git a/libraries/classes/Config/PageSettings.php b/libraries/classes/Config/PageSettings.php index e8af7c3ea58e..c67dd96dcf43 100644 --- a/libraries/classes/Config/PageSettings.php +++ b/libraries/classes/Config/PageSettings.php @@ -81,11 +81,11 @@ public function __construct($formGroupName, $elemId = null) if (isset($_POST['submit_save']) && $_POST['submit_save'] == $formGroupName ) { - $this->_processPageSettings($formDisplay, $cf, $error); + $this->processPageSettings($formDisplay, $cf, $error); } // Display forms - $this->_HTML = $this->_getPageSettingsDisplay($formDisplay, $error); + $this->_HTML = $this->getPageSettingsDisplay($formDisplay, $error); } /** @@ -97,7 +97,7 @@ public function __construct($formGroupName, $elemId = null) * * @return void */ - private function _processPageSettings(&$formDisplay, &$cf, &$error) + private function processPageSettings(&$formDisplay, &$cf, &$error) { if (! $formDisplay->process(false) || $formDisplay->hasErrors()) { return; @@ -125,7 +125,7 @@ private function _processPageSettings(&$formDisplay, &$cf, &$error) * * @return void */ - private function _storeError(&$formDisplay, &$error) + private function storeError(&$formDisplay, &$error) { $retval = ''; if ($error) { @@ -152,13 +152,13 @@ private function _storeError(&$formDisplay, &$error) * * @return string */ - private function _getPageSettingsDisplay(&$formDisplay, &$error) + private function getPageSettingsDisplay(&$formDisplay, &$error) { $response = Response::getInstance(); $retval = ''; - $this->_storeError($formDisplay, $error); + $this->storeError($formDisplay, $error); $retval .= '
'; $retval .= '
'; diff --git a/libraries/classes/Database/Qbe.php b/libraries/classes/Database/Qbe.php index 6fd889fae42d..4286dd00f672 100644 --- a/libraries/classes/Database/Qbe.php +++ b/libraries/classes/Database/Qbe.php @@ -264,10 +264,10 @@ public function __construct( $this->relation = $relation; $this->template = $template; - $this->_loadCriterias(); + $this->loadCriterias(); // Sets criteria parameters - $this->_setSearchParams(); - $this->_setCriteriaTablesAndColumns(); + $this->setSearchParams(); + $this->setCriteriaTablesAndColumns(); } /** @@ -275,7 +275,7 @@ public function __construct( * * @return static */ - private function _loadCriterias() + private function loadCriterias() { if ($this->_currentSearch === null || $this->_currentSearch->getCriterias() === null @@ -294,7 +294,7 @@ private function _loadCriterias() * * @return SavedSearches */ - private function _getCurrentSearch() + private function getCurrentSearch() { return $this->_currentSearch; } @@ -304,9 +304,9 @@ private function _getCurrentSearch() * * @return void */ - private function _setSearchParams() + private function setSearchParams() { - $criteriaColumnCount = $this->_initializeCriteriasCount(); + $criteriaColumnCount = $this->initializeCriteriasCount(); $this->_criteriaColumnInsert = Core::ifSetOr( $_POST['criteriaColumnInsert'], @@ -341,7 +341,7 @@ private function _setSearchParams() * * @return void */ - private function _setCriteriaTablesAndColumns() + private function setCriteriaTablesAndColumns() { // The tables list sent by a previously submitted form if (Core::isValid($_POST['TableList'], 'array')) { @@ -401,7 +401,7 @@ private function _setCriteriaTablesAndColumns() * * @return string HTML for select options */ - private function _showColumnSelectCell($column_number, $selected = '') + private function showColumnSelectCell($column_number, $selected = '') { return $this->template->render('database/qbe/column_select_cell', [ 'column_number' => $column_number, @@ -418,7 +418,7 @@ private function _showColumnSelectCell($column_number, $selected = '') * * @return string HTML for select options */ - private function _getSortSelectCell( + private function getSortSelectCell( $columnNumber, $selected = '' ) { @@ -437,9 +437,9 @@ private function _getSortSelectCell( * * @return string HTML for select options */ - private function _getSortOrderSelectCell($columnNumber, $sortOrder) + private function getSortOrderSelectCell($columnNumber, $sortOrder) { - $totalColumnCount = $this->_getNewColumnCount(); + $totalColumnCount = $this->getNewColumnCount(); return $this->template->render('database/qbe/sort_order_select_cell', [ 'total_column_count' => $totalColumnCount, @@ -453,7 +453,7 @@ private function _getSortOrderSelectCell($columnNumber, $sortOrder) * * @return int new column count */ - private function _getNewColumnCount() + private function getNewColumnCount() { $totalColumnCount = $this->_criteria_column_count; if (! empty($this->_criteriaColumnInsert)) { @@ -471,7 +471,7 @@ private function _getNewColumnCount() * * @return string HTML for search table's row */ - private function _getColumnNamesRow() + private function getColumnNamesRow() { $html_output = ''; @@ -480,7 +480,7 @@ private function _getColumnNamesRow() if (isset($this->_criteriaColumnInsert[$column_index]) && $this->_criteriaColumnInsert[$column_index] == 'on' ) { - $html_output .= $this->_showColumnSelectCell( + $html_output .= $this->showColumnSelectCell( $new_column_count ); $new_column_count++; @@ -497,7 +497,7 @@ private function _getColumnNamesRow() $this->_formColumns[$new_column_count] = $_POST['criteriaColumn'][$column_index]; } - $html_output .= $this->_showColumnSelectCell( + $html_output .= $this->showColumnSelectCell( $new_column_count, $selected ); @@ -513,7 +513,7 @@ private function _getColumnNamesRow() * * @return string HTML for search table's row */ - private function _getColumnAliasRow() + private function getColumnAliasRow() { $html_output = ''; @@ -561,7 +561,7 @@ private function _getColumnAliasRow() * * @return string HTML for search table's row */ - private function _getSortRow() + private function getSortRow() { $html_output = ''; @@ -572,7 +572,7 @@ private function _getSortRow() && isset($this->_criteriaColumnInsert[$colInd]) && $this->_criteriaColumnInsert[$colInd] == 'on' ) { - $html_output .= $this->_getSortSelectCell($new_column_count); + $html_output .= $this->getSortSelectCell($new_column_count); $new_column_count++; } // end if @@ -604,7 +604,7 @@ private function _getSortRow() $this->_formSorts[$new_column_count] = ''; } - $html_output .= $this->_getSortSelectCell( + $html_output .= $this->getSortSelectCell( $new_column_count, $selected ); @@ -619,7 +619,7 @@ private function _getSortRow() * * @return string HTML for search table's row */ - private function _getSortOrder() + private function getSortOrder() { $html_output = ''; @@ -630,7 +630,7 @@ private function _getSortOrder() && isset($this->_criteriaColumnInsert[$colInd]) && $this->_criteriaColumnInsert[$colInd] == 'on' ) { - $html_output .= $this->_getSortOrderSelectCell( + $html_output .= $this->getSortOrderSelectCell( $new_column_count, null ); @@ -651,7 +651,7 @@ private function _getSortOrder() = $_POST['criteriaSortOrder'][$colInd]; } - $html_output .= $this->_getSortOrderSelectCell( + $html_output .= $this->getSortOrderSelectCell( $new_column_count, $sortOrder ); @@ -666,7 +666,7 @@ private function _getSortOrder() * * @return string HTML for search table's row */ - private function _getShowRow() + private function getShowRow() { $html_output = ''; @@ -711,7 +711,7 @@ private function _getShowRow() * * @return string HTML for search table's row */ - private function _getCriteriaInputboxRow() + private function getCriteriaInputboxRow() { $html_output = ''; @@ -778,7 +778,7 @@ private function _getCriteriaInputboxRow() * * @return string HTML for modification cell */ - private function _getAndOrColCell( + private function getAndOrColCell( $column_number, $selected = null, $last_column = false @@ -811,7 +811,7 @@ private function _getAndOrColCell( * * @return string HTML for search table's row */ - private function _getModifyColumnsRow() + private function getModifyColumnsRow() { $html_output = ''; @@ -821,7 +821,7 @@ private function _getModifyColumnsRow() && isset($this->_criteriaColumnInsert[$column_index]) && $this->_criteriaColumnInsert[$column_index] == 'on' ) { - $html_output .= $this->_getAndOrColCell($new_column_count); + $html_output .= $this->getAndOrColCell($new_column_count); $new_column_count++; } // end if @@ -846,7 +846,7 @@ private function _getModifyColumnsRow() $checked_options['and'] = ' checked="checked"'; $checked_options['or'] = ''; } - $html_output .= $this->_getAndOrColCell( + $html_output .= $this->getAndOrColCell( $new_column_count, $checked_options, $column_index + 1 == $this->_criteria_column_count @@ -865,7 +865,7 @@ private function _getModifyColumnsRow() * * @return string HTML table rows */ - private function _getInputboxRow($new_row_index) + private function getInputboxRow($new_row_index) { $html_output = ''; $new_column_count = 0; @@ -916,7 +916,7 @@ private function _getInputboxRow($new_row_index) * * @return string HTML table rows */ - private function _getInsDelAndOrCriteriaRows() + private function getInsDelAndOrCriteriaRows() { $html_output = ''; $new_row_count = 0; @@ -932,7 +932,7 @@ private function _getInsDelAndOrCriteriaRows() 'row_index' => $new_row_count, 'checked_options' => $checked_options, ]); - $html_output .= $this->_getInputboxRow( + $html_output .= $this->getInputboxRow( $new_row_count ); $new_row_count++; @@ -961,7 +961,7 @@ private function _getInsDelAndOrCriteriaRows() 'row_index' => $new_row_count, 'checked_options' => $checked_options, ]); - $html_output .= $this->_getInputboxRow( + $html_output .= $this->getInputboxRow( $new_row_count ); $new_row_count++; @@ -977,7 +977,7 @@ private function _getInsDelAndOrCriteriaRows() * * @return string Select clause */ - private function _getSelectClause() + private function getSelectClause() { $select_clause = ''; $select_clauses = []; @@ -1009,7 +1009,7 @@ private function _getSelectClause() * * @return string Where clause */ - private function _getWhereClause() + private function getWhereClause() { $where_clause = ''; $criteria_cnt = 0; @@ -1095,7 +1095,7 @@ private function _getWhereClause() * * @return string Order By clause */ - private function _getOrderByClause() + private function getOrderByClause() { $orderby_clause = ''; $orderby_clauses = []; @@ -1150,7 +1150,7 @@ private function _getOrderByClause() * * @return array having UNIQUE and INDEX columns */ - private function _getIndexes( + private function getIndexes( array $search_tables, array $search_columns, array $where_clause_columns @@ -1197,7 +1197,7 @@ private function _getIndexes( * * @return array having UNIQUE and INDEX columns */ - private function _getLeftJoinColumnCandidates( + private function getLeftJoinColumnCandidates( array $search_tables, array $search_columns, array $where_clause_columns @@ -1205,7 +1205,7 @@ private function _getLeftJoinColumnCandidates( $this->dbi->selectDb($this->_db); // Get unique columns and index columns - $indexes = $this->_getIndexes( + $indexes = $this->getIndexes( $search_tables, $search_columns, $where_clause_columns @@ -1214,7 +1214,7 @@ private function _getLeftJoinColumnCandidates( $index_columns = $indexes['index']; [$candidate_columns, $needsort] - = $this->_getLeftJoinColumnCandidatesBest( + = $this->getLeftJoinColumnCandidatesBest( $search_tables, $where_clause_columns, $unique_columns, @@ -1261,7 +1261,7 @@ private function _getLeftJoinColumnCandidates( * * @return string table name */ - private function _getMasterTable( + private function getMasterTable( array $search_tables, array $search_columns, array $where_clause_columns, @@ -1277,7 +1277,7 @@ private function _getMasterTable( // (When the control user is the same as the normal user // because they are using one of their databases as pmadb, // the last db selected is not always the one where we need to work) - $candidate_columns = $this->_getLeftJoinColumnCandidates( + $candidate_columns = $this->getLeftJoinColumnCandidates( $search_tables, $search_columns, $where_clause_columns @@ -1349,7 +1349,7 @@ private function _getMasterTable( * * @return array */ - private function _getWhereClauseTablesAndColumns() + private function getWhereClauseTablesAndColumns() { $where_clause_columns = []; $where_clause_tables = []; @@ -1388,7 +1388,7 @@ private function _getWhereClauseTablesAndColumns() * * @return string FROM clause */ - private function _getFromClause(array $formColumns) + private function getFromClause(array $formColumns) { $from_clause = ''; if (empty($formColumns)) { @@ -1415,7 +1415,7 @@ private function _getFromClause(array $formColumns) } // end while // Create LEFT JOINS out of Relations - $from_clause = $this->_getJoinForFromClause( + $from_clause = $this->getJoinForFromClause( $search_tables, $search_columns ); @@ -1441,23 +1441,23 @@ private function _getFromClause(array $formColumns) * * @return string table name */ - private function _getJoinForFromClause(array $searchTables, array $searchColumns) + private function getJoinForFromClause(array $searchTables, array $searchColumns) { // $relations[master_table][foreign_table] => clause $relations = []; // Fill $relations with inter table relationship data foreach ($searchTables as $oneTable) { - $this->_loadRelationsForTable($relations, $oneTable); + $this->loadRelationsForTable($relations, $oneTable); } // Get tables and columns with valid where clauses - $validWhereClauses = $this->_getWhereClauseTablesAndColumns(); + $validWhereClauses = $this->getWhereClauseTablesAndColumns(); $whereClauseTables = $validWhereClauses['where_clause_tables']; $whereClauseColumns = $validWhereClauses['where_clause_columns']; // Get master table - $master = $this->_getMasterTable( + $master = $this->getMasterTable( $searchTables, $searchColumns, $whereClauseColumns, @@ -1472,7 +1472,7 @@ private function _getJoinForFromClause(array $searchTables, array $searchColumns $finalized[$master] = ''; } // Fill the $finalized array with JOIN clauses for each table - $this->_fillJoinClauses($finalized, $relations, $searchTables); + $this->fillJoinClauses($finalized, $relations, $searchTables); // JOIN clause $join = ''; @@ -1495,7 +1495,7 @@ private function _getJoinForFromClause(array $searchTables, array $searchColumns $table = $reference['table_name']; - $this->_loadRelationsForTable($relations, $table); + $this->loadRelationsForTable($relations, $table); // Make copies $tempFinalized = $finalized; @@ -1503,7 +1503,7 @@ private function _getJoinForFromClause(array $searchTables, array $searchColumns $tempSearchTables[] = $table; // Try joining with the added table - $this->_fillJoinClauses( + $this->fillJoinClauses( $tempFinalized, $relations, $tempSearchTables @@ -1567,7 +1567,7 @@ private function _getJoinForFromClause(array $searchTables, array $searchColumns * * @return void */ - private function _loadRelationsForTable(array &$relations, $oneTable) + private function loadRelationsForTable(array &$relations, $oneTable) { $relations[$oneTable] = []; @@ -1608,7 +1608,7 @@ private function _loadRelationsForTable(array &$relations, $oneTable) * * @return void */ - private function _fillJoinClauses(array &$finalized, array $relations, array $searchTables) + private function fillJoinClauses(array &$finalized, array $relations, array $searchTables) { while (true) { $added = false; @@ -1651,20 +1651,20 @@ private function _fillJoinClauses(array &$finalized, array $relations, array $se * * @return string SQL query */ - private function _getSQLQuery(array $formColumns) + private function getSQLQuery(array $formColumns) { $sql_query = ''; // get SELECT clause - $sql_query .= $this->_getSelectClause(); + $sql_query .= $this->getSelectClause(); // get FROM clause - $from_clause = $this->_getFromClause($formColumns); + $from_clause = $this->getFromClause($formColumns); if (! empty($from_clause)) { $sql_query .= 'FROM ' . htmlspecialchars($from_clause) . "\n"; } // get WHERE clause - $sql_query .= $this->_getWhereClause(); + $sql_query .= $this->getWhereClause(); // get ORDER BY clause - $sql_query .= $this->_getOrderByClause(); + $sql_query .= $this->getOrderByClause(); return $sql_query; } @@ -1673,16 +1673,16 @@ public function getSelectionForm(): string { global $cfgRelation; - $savedSearchesField = $cfgRelation['savedsearcheswork'] ? $this->_getSavedSearchesField() : ''; + $savedSearchesField = $cfgRelation['savedsearcheswork'] ? $this->getSavedSearchesField() : ''; - $columnNamesRow = $this->_getColumnNamesRow(); - $columnAliasRow = $this->_getColumnAliasRow(); - $showRow = $this->_getShowRow(); - $sortRow = $this->_getSortRow(); - $sortOrder = $this->_getSortOrder(); - $criteriaInputBoxRow = $this->_getCriteriaInputboxRow(); - $insDelAndOrCriteriaRows = $this->_getInsDelAndOrCriteriaRows(); - $modifyColumnsRow = $this->_getModifyColumnsRow(); + $columnNamesRow = $this->getColumnNamesRow(); + $columnAliasRow = $this->getColumnAliasRow(); + $showRow = $this->getShowRow(); + $sortRow = $this->getSortRow(); + $sortOrder = $this->getSortOrder(); + $criteriaInputBoxRow = $this->getCriteriaInputboxRow(); + $insDelAndOrCriteriaRows = $this->getInsDelAndOrCriteriaRows(); + $modifyColumnsRow = $this->getModifyColumnsRow(); $this->_new_row_count--; $url_params = []; @@ -1693,7 +1693,7 @@ public function getSelectionForm(): string if (empty($this->_formColumns)) { $this->_formColumns = []; } - $sqlQuery = $this->_getSQLQuery($this->_formColumns); + $sqlQuery = $this->getSQLQuery($this->_formColumns); return $this->template->render('database/qbe/selection_form', [ 'db' => $this->_db, @@ -1718,13 +1718,13 @@ public function getSelectionForm(): string * * @return string */ - private function _getSavedSearchesField() + private function getSavedSearchesField() { $html_output = __('Saved bookmarked search:'); $html_output .= '