Skip to content

Commit

Permalink
Merge #16159 - Remove underscore prefix from method names
Browse files Browse the repository at this point in the history
Pull-request: #16159

Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Jun 2, 2020
2 parents 7623fed + 9668731 commit 7c50dc7
Show file tree
Hide file tree
Showing 72 changed files with 696 additions and 701 deletions.
14 changes: 7 additions & 7 deletions libraries/classes/Config.php
Expand Up @@ -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');
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -617,7 +617,7 @@ public function loadUserPreferences(): void
}

// set connection collation
$this->_setConnectionCollation();
$this->setConnectionCollation();
}

/**
Expand Down Expand Up @@ -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)) {
Expand All @@ -1224,15 +1224,15 @@ 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');
}

/**
* Renders user configured footer
*/
public static function renderHeader(): string
{
return self::_renderCustom(CUSTOM_HEADER_FILE, 'pma_header');
return self::renderCustom(CUSTOM_HEADER_FILE, 'pma_header');
}

/**
Expand Down
42 changes: 21 additions & 21 deletions libraries/classes/Config/FormDisplay.php
Expand Up @@ -196,7 +196,7 @@ public function process($allowPartialSave = true, $checkFormSubmit = true)
*
* @return void
*/
private function _validate()
private function validate()
{
if ($this->_isValidated) {
return;
Expand Down Expand Up @@ -251,7 +251,7 @@ private function _validate()
*
* @return string
*/
private function _displayForms(
private function displayForms(
$showRestoreDefault,
array &$jsDefault,
array &$js,
Expand Down Expand Up @@ -279,7 +279,7 @@ private function _displayForms(
? ! isset($this->_userprefsDisallow[$path])
: null;
// display input
$htmlOutput .= $this->_displayFieldInput(
$htmlOutput .= $this->displayFieldInput(
$form,
$field,
$path,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -404,7 +404,7 @@ public function getDisplay(
*
* @return string|null HTML for input field
*/
private function _displayFieldInput(
private function displayFieldInput(
Form $form,
$field,
$systemPath,
Expand Down Expand Up @@ -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 . '\': ';
Expand Down Expand Up @@ -549,7 +549,7 @@ private function _displayFieldInput(
*/
public function displayErrors()
{
$this->_validate();
$this->validate();
if (count($this->_errors) === 0) {
return null;
}
Expand All @@ -575,7 +575,7 @@ public function displayErrors()
*/
public function fixErrors()
{
$this->_validate();
$this->validate();
if (count($this->_errors) === 0) {
return;
}
Expand All @@ -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
Expand Down Expand Up @@ -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 = [];
Expand Down Expand Up @@ -712,7 +712,7 @@ public function save($forms, $allowPartialSave = true)
}
break;
case 'select':
$successfullyValidated = $this->_validateSelect(
$successfullyValidated = $this->validateSelect(
$_POST[$key],
$form->getOptionValueList($systemPath)
);
Expand All @@ -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;
}

Expand All @@ -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;
}
Expand Down Expand Up @@ -792,7 +792,7 @@ public function save($forms, $allowPartialSave = true)
}

// don't look for non-critical errors
$this->_validate();
$this->validate();

return $result;
}
Expand Down Expand Up @@ -823,7 +823,7 @@ public function getDocLink($path)

return MySQLDocumentation::getDocumentationLink(
'config',
'cfg_' . $this->_getOptName($path),
'cfg_' . $this->getOptName($path),
Sanitize::isSetup() ? '../' : './'
);
}
Expand All @@ -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);
}
Expand All @@ -845,7 +845,7 @@ private function _getOptName($path)
*
* @return void
*/
private function _loadUserprefsInfo()
private function loadUserprefsInfo()
{
if ($this->_userprefsKeys !== null) {
return;
Expand All @@ -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') {
Expand Down Expand Up @@ -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);
Expand Down
12 changes: 6 additions & 6 deletions libraries/classes/Config/PageSettings.php
Expand Up @@ -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);
}

/**
Expand All @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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 .= '<div id="' . $this->_elemId . '">';
$retval .= '<div class="page_settings">';
Expand Down

0 comments on commit 7c50dc7

Please sign in to comment.