Remove useless parenthesis

Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
This commit is contained in:
Hugues Peccatte 2019-01-13 00:27:55 +01:00
parent 607c33b40c
commit f06883d2a7
45 changed files with 137 additions and 147 deletions

View File

@ -147,7 +147,7 @@ $response->addHTML($main);
$num_cols = $centralColumns->getColumnsCount($db, $pos, $max_rows);
$message = Message::success(
sprintf(__('Showing rows %1$s - %2$s.'), ($pos + 1), ($pos + $num_cols))
sprintf(__('Showing rows %1$s - %2$s.'), $pos + 1, $pos + $num_cols)
);
if (isset($tmp_msg) && $tmp_msg !== true) {
$message = $tmp_msg;

View File

@ -51,9 +51,9 @@ if (isset($_POST['send_error_report'])
} else {
$_SESSION['prev_error_subm_time'] = time();
$_SESSION['error_subm_count'] = (
(isset($_SESSION['error_subm_count']))
isset($_SESSION['error_subm_count'])
? ($_SESSION['error_subm_count'] + 1)
: (0)
: 0
);
}
}

View File

@ -304,7 +304,7 @@ if ($export_type == 'server') {
// preference over SQL Query aliases.
$parser = new \PhpMyAdmin\SqlParser\Parser($sql_query);
$aliases = [];
if ((! empty($parser->statements[0]))
if (! empty($parser->statements[0])
&& ($parser->statements[0] instanceof \PhpMyAdmin\SqlParser\Statements\SelectStatement)
) {
$aliases = \PhpMyAdmin\SqlParser\Utils\Misc::getAliases($parser->statements[0], $db);

View File

@ -56,7 +56,7 @@ if (! isset($gis_data['gis_type'])) {
mb_strpos($_POST['value'], "(") - $start
);
}
if ((! isset($gis_data['gis_type']))
if (! isset($gis_data['gis_type'])
|| (! in_array($gis_data['gis_type'], $gis_types))
) {
$gis_data['gis_type'] = $gis_types[0];
@ -111,7 +111,7 @@ if (isset($_POST['generate']) && $_POST['generate'] == true) {
$geom_count = 1;
if ($geom_type == 'GEOMETRYCOLLECTION') {
$geom_count = (isset($gis_data[$geom_type]['geom_count']))
$geom_count = isset($gis_data[$geom_type]['geom_count'])
? intval($gis_data[$geom_type]['geom_count']) : 1;
if (isset($gis_data[$geom_type]['add_geom'])) {
$geom_count++;

View File

@ -724,7 +724,7 @@ $js_messages['phpErrorsBeingSubmitted'] = '<div class="error">'
)
. '<br>'
. '<img src="'
. ($GLOBALS['PMA_Theme']->getImgPath('ajax_clock_small.gif'))
. $GLOBALS['PMA_Theme']->getImgPath('ajax_clock_small.gif')
. '" width="16" height="16" alt="ajax clock">'
. '</div>';
$js_messages['strCopyQueryButtonSuccess'] = __('Successfully copied!');
@ -900,7 +900,7 @@ Sanitize::printJsValue(
/* l10n: Month-year order for calendar, use either "calendar-month-year"
* or "calendar-year-month".
*/
(__('calendar-month-year') == 'calendar-year-month')
__('calendar-month-year') == 'calendar-year-month'
);
/* l10n: Year suffix for calendar, "none" is empty. */
$year_suffix = _pgettext('Year suffix', 'none');

View File

@ -69,7 +69,7 @@ class CheckUserPrivileges
$show_grants_str = mb_substr(
$row,
6,
(mb_strpos($row, ' ON ') - 6)
mb_strpos($row, ' ON ') - 6
);
$show_grants_tblname = mb_substr(

View File

@ -893,8 +893,8 @@ class FormDisplay
$opts['comment_warning'] = true;
}
if (! $GLOBALS['PMA_Config']->get('is_setup')) {
if (($systemPath == 'MaxDbList' || $systemPath == 'MaxTableList'
|| $systemPath == 'QueryHistoryMax')
if ($systemPath == 'MaxDbList' || $systemPath == 'MaxTableList'
|| $systemPath == 'QueryHistoryMax'
) {
$opts['comment'] = sprintf(
__('maximum %s'),

View File

@ -570,7 +570,7 @@ class Validator
return '';
}
$result = preg_match($regex, Util::requestString($values[$path]));
return [$path => ($result ? '' : __('Incorrect value!'))];
return [$path => $result ? '' : __('Incorrect value!')];
}
/**

View File

@ -309,7 +309,7 @@ class DatabaseStructureController extends DatabaseController
'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,
@ -644,12 +644,12 @@ class DatabaseStructureController extends DatabaseController
'formatted_size' => $formatted_size,
'unit' => $unit,
'overhead' => $overhead,
'create_time' => (isset($create_time) && $create_time
? Util::localisedDate(strtotime($create_time)) : '-'),
'update_time' => (isset($update_time) && $update_time
? Util::localisedDate(strtotime($update_time)) : '-'),
'check_time' => (isset($check_time) && $check_time
? Util::localisedDate(strtotime($check_time)) : '-'),
'create_time' => isset($create_time) && $create_time
? Util::localisedDate(strtotime($create_time)) : '-',
'update_time' => isset($update_time) && $update_time
? Util::localisedDate(strtotime($update_time)) : '-',
'check_time' => isset($check_time) && $check_time
? Util::localisedDate(strtotime($check_time)) : '-',
'charset' => isset($charset)
? $charset : '',
'is_show_stats' => $this->_is_show_stats,
@ -691,9 +691,9 @@ class DatabaseStructureController extends DatabaseController
'db_charset' => $db_charset,
'sum_size' => $sum_size,
'overhead_size' => $overhead_size,
'create_time_all' => ($create_time_all ? Util::localisedDate(strtotime($create_time_all)) : '-'),
'update_time_all' => ($update_time_all ? Util::localisedDate(strtotime($update_time_all)) : '-'),
'check_time_all' => ($check_time_all ? Util::localisedDate(strtotime($check_time_all)) : '-'),
'create_time_all' => $create_time_all ? Util::localisedDate(strtotime($create_time_all)) : '-',
'update_time_all' => $update_time_all ? Util::localisedDate(strtotime($update_time_all)) : '-',
'check_time_all' => $check_time_all ? Util::localisedDate(strtotime($check_time_all)) : '-',
'approx_rows' => $overall_approx_rows,
'num_favorite_tables' => $GLOBALS['cfg']['NumFavoriteTables'],
'db' => $GLOBALS['db'],

View File

@ -570,9 +570,9 @@ class TableSearchController extends TableController
'criteria_column_types' => isset($_POST['criteriaColumnTypes']) ? $_POST['criteriaColumnTypes'] : null,
'sql_types' => $this->dbi->types,
'max_rows' => intval($GLOBALS['cfg']['MaxRows']),
'max_plot_limit' => (! empty($_POST['maxPlotLimit'])
'max_plot_limit' => ! empty($_POST['maxPlotLimit'])
? intval($_POST['maxPlotLimit'])
: intval($GLOBALS['cfg']['maxRowPlotLimit'])),
: intval($GLOBALS['cfg']['maxRowPlotLimit']),
])
);
}

View File

@ -923,7 +923,7 @@ class Qbe
$html_output .= $this->_getAndOrColCell(
$new_column_count,
$checked_options,
($column_index + 1 == $this->_criteria_column_count)
$column_index + 1 == $this->_criteria_column_count
);
$new_column_count++;
} // end for

View File

@ -1423,7 +1423,7 @@ class Results
&& ($displayParts['del_lnk'] != self::NO_EDIT_OR_DELETE) ? 4 : 0;
$button_html .= '<td ' . $colspan . '></td>';
} elseif (($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_NONE)) {
} elseif ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_NONE) {
// ... elseif display an empty column if the actions links are
// disabled to match the rest of the table
$button_html .= '<th class="column_action"></th>';
@ -1451,7 +1451,7 @@ class Results
private function _getTableCommentsArray(array $analyzed_sql_results)
{
if (! $GLOBALS['cfg']['ShowBrowseComments']
|| (empty($analyzed_sql_results['statement']->from))
|| empty($analyzed_sql_results['statement']->from)
) {
return [];
}
@ -2893,7 +2893,7 @@ class Results
include_once ROOT_PATH . 'libraries/special_schema_links.inc.php';
if (isset($GLOBALS['special_schema_links'])
&& (! empty($GLOBALS['special_schema_links'][$dbLower][$tblLower][$nameLower]))
&& ! empty($GLOBALS['special_schema_links'][$dbLower][$tblLower][$nameLower])
) {
$linking_url = $this->_getSpecialLinkUrl(
$row[$i],
@ -3315,7 +3315,7 @@ class Results
'table' => $this->__get('table'),
'sql_query' => $url_sql_query,
'message_to_show' => __('The row has been deleted.'),
'goto' => (empty($goto) ? 'tbl_sql.php' : $goto),
'goto' => empty($goto) ? 'tbl_sql.php' : $goto,
];
$lnk_goto = 'sql.php' . Url::getCommonRaw($_url_params);
@ -4250,7 +4250,7 @@ class Results
}
$navigation = '';
if (($displayParts['nav_bar'] == '1') && ! is_null($statement) && (empty($statement->limit))) {
if ($displayParts['nav_bar'] == '1' && ! is_null($statement) && empty($statement->limit)) {
$navigation = $this->_getTableNavigation(
$pos_next,
$pos_prev,
@ -5272,7 +5272,7 @@ class Results
if (! empty($analyzed_sql_results['statement']->expr)) {
foreach ($analyzed_sql_results['statement']->expr as $expr) {
if (empty($expr->alias) || (empty($expr->column))) {
if (empty($expr->alias) || empty($expr->column)) {
continue;
}
if (strcasecmp($meta->name, $expr->alias) == 0) {

View File

@ -322,7 +322,7 @@ class GisGeometryCollection extends GisGeometry
= mb_substr(
$geom_col,
$start,
($count + 1 - $start)
$count + 1 - $start
);
$start = $count + 2;
}
@ -345,7 +345,7 @@ class GisGeometryCollection extends GisGeometry
*/
public function generateWkt(array $gis_data, $index, $empty = '')
{
$geom_count = (isset($gis_data['GEOMETRYCOLLECTION']['geom_count']))
$geom_count = isset($gis_data['GEOMETRYCOLLECTION']['geom_count'])
? $gis_data['GEOMETRYCOLLECTION']['geom_count'] : 1;
$wkt = 'GEOMETRYCOLLECTION(';
for ($i = 0; $i < $geom_count; $i++) {

View File

@ -537,7 +537,7 @@ class GisPolygon extends GisGeometry
// Always keep $epsilon < 1 to go with the reduction logic down here
$epsilon = 0.1;
$denominator = sqrt(pow(($y1 - $y0), 2) + pow(($x0 - $x1), 2));
$denominator = sqrt(pow($y1 - $y0, 2) + pow($x0 - $x1, 2));
$pointA = [];
$pointB = [];

View File

@ -256,7 +256,7 @@ class Header
'confirm' => $GLOBALS['cfg']['Confirm'],
'LoginCookieValidity' => $GLOBALS['cfg']['LoginCookieValidity'],
'session_gc_maxlifetime' => (int) ini_get('session.gc_maxlifetime'),
'logged_in' => (isset($GLOBALS['dbi']) ? $GLOBALS['dbi']->isUserType('logged') : false),
'logged_in' => isset($GLOBALS['dbi']) ? $GLOBALS['dbi']->isUserType('logged') : false,
'is_https' => $GLOBALS['PMA_Config']->isHttps(),
'rootPath' => $GLOBALS['PMA_Config']->getRootPath(),
'arg_separator' => Url::getArgSeparator(),

View File

@ -560,8 +560,8 @@ class Import
{
return (int) substr(
$last_cumulative_size,
(strpos($last_cumulative_size, ",") + 1),
(strlen($last_cumulative_size) - strpos($last_cumulative_size, ","))
strpos($last_cumulative_size, ",") + 1,
strlen($last_cumulative_size) - strpos($last_cumulative_size, ",")
);
}
@ -586,7 +586,7 @@ class Import
return [
$m,
$d,
($m . "," . $d),
$m . "," . $d,
];
}
@ -1145,11 +1145,11 @@ class Import
$is_varchar = false;
}
$tempSQLStr .= (($is_varchar) ? "'" : "");
$tempSQLStr .= $is_varchar ? "'" : "";
$tempSQLStr .= $GLOBALS['dbi']->escapeString(
(string) $tables[$i][self::ROWS][$j][$k]
);
$tempSQLStr .= (($is_varchar) ? "'" : "");
$tempSQLStr .= $is_varchar ? "'" : "";
}
if ($k != ($num_cols - 1)) {
@ -1398,7 +1398,7 @@ class Import
if ((! (($statement instanceof UpdateStatement)
|| ($statement instanceof DeleteStatement)))
|| (! empty($statement->join))
|| ! empty($statement->join)
) {
$error = $error_msg;
break;

View File

@ -31,7 +31,8 @@ class Linter
public static function getLines($str)
{
if ((! ($str instanceof UtfString))
&& (defined('USE_UTF_STRINGS')) && (USE_UTF_STRINGS)
&& defined('USE_UTF_STRINGS')
&& USE_UTF_STRINGS
) {
// If the lexer uses UtfString for processing then the position will
// represent the position of the character and not the position of

View File

@ -512,7 +512,7 @@ class Menu
$tabs['operation']['text'] = __('Operations');
$tabs['operation']['icon'] = 'b_tblops';
if (($is_superuser || $isCreateOrGrantUser)) {
if ($is_superuser || $isCreateOrGrantUser) {
$tabs['privileges']['link'] = 'server_privileges.php';
$tabs['privileges']['args']['checkprivsdb'] = $this->_db;
// stay on database view

View File

@ -72,7 +72,7 @@ class MultSubmits
) {
$urlParams = [
'query_type' => $what,
'reload' => (! empty($reload) ? 1 : 0),
'reload' => ! empty($reload) ? 1 : 0,
];
if (mb_strpos(' ' . $action, 'db_') == 1) {
$urlParams['db'] = $db;

View File

@ -254,7 +254,7 @@ class NavigationTree
}
$navItems = (int) $GLOBALS['cfg']['FirstLevelNavigationItems'];
$retval = floor((count($prefixMap) / $navItems)) * $navItems;
$retval = floor(count($prefixMap) / $navItems) * $navItems;
return $retval;
}
@ -1071,7 +1071,7 @@ class NavigationTree
// if node name itself is in sterile, then allow
if ($node->is_group
|| (! in_array($parentName, $sterile) && ! $node->isNew)
|| (in_array($node->real_name, $sterile))
|| in_array($node->real_name, $sterile)
) {
$retval .= "<div class='block'>";
$iClass = '';

View File

@ -27,9 +27,7 @@ abstract class NodeDatabaseChildContainer extends NodeDatabaseChild
parent::__construct($name, $type);
if ($GLOBALS['cfg']['NavigationTreeEnableGrouping']) {
$this->separator = $GLOBALS['cfg']['NavigationTreeTableSeparator'];
$this->separator_depth = (int) (
$GLOBALS['cfg']['NavigationTreeTableLevel']
);
$this->separator_depth = (int) $GLOBALS['cfg']['NavigationTreeTableLevel'];
}
}

View File

@ -749,8 +749,8 @@ class ExportSql extends ExportPlugin
// We want exported AUTO_INCREMENT columns to have still same value,
// do this only for recent MySQL exports
if ((! isset($GLOBALS['sql_compatibility'])
|| $GLOBALS['sql_compatibility'] == 'NONE')
if (! isset($GLOBALS['sql_compatibility'])
|| $GLOBALS['sql_compatibility'] == 'NONE'
) {
$head .= 'SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";' . $crlf;
}
@ -1794,7 +1794,7 @@ class ExportSql extends ExportPlugin
) . $alter_footer;
}
if (! empty($indexes) || (! empty($indexes_fulltext))) {
if (! empty($indexes) || ! empty($indexes_fulltext)) {
$sql_indexes = $this->generateComment(
$crlf,
$sql_indexes,
@ -1813,7 +1813,7 @@ class ExportSql extends ExportPlugin
}
// Generating auto-increment-related query.
if (! empty($auto_increment) && ($update_indexes_increments)) {
if (! empty($auto_increment) && $update_indexes_increments) {
$sql_auto_increments_query = $alter_header . $crlf . ' MODIFY '
. implode(',' . $crlf . ' MODIFY ', $auto_increment);
if (isset($GLOBALS['sql_auto_increment'])
@ -2827,9 +2827,9 @@ class ExportSql extends ExportPlugin
}
if ($statement->options->has('TRIGGER')
|| ($statement->options->has('PROCEDURE'))
|| ($statement->options->has('FUNCTION'))
|| ($statement->options->has('VIEW'))
|| $statement->options->has('PROCEDURE')
|| $statement->options->has('FUNCTION')
|| $statement->options->has('VIEW')
) {
// Repalcing the body.
for ($i = 0, $count = count($statement->body); $i < $count; ++$i) {

View File

@ -253,7 +253,7 @@ class ExportXml extends ExportPlugin
. '-->' . $crlf . $crlf;
$head .= '<pma_xml_export version="1.0"'
. (($export_struct)
. ($export_struct
? ' xmlns:pma="https://www.phpmyadmin.net/some_doc_url/"'
: '')
. '>' . $crlf;

View File

@ -113,7 +113,7 @@ class Pdf extends PdfLib
$current_page = $this->page;
if ((($y + $h) > $this->PageBreakTrigger)
&& (! $this->InFooter)
&& ($this->AcceptPageBreak())
&& $this->AcceptPageBreak()
) {
if ($addpage) {
//Automatic page break

View File

@ -160,7 +160,7 @@ class ImportSql extends ImportPlugin
}
// Extracting remaining statements.
while ((! $error) && (! $timeout_passed) && (! empty($bq->query))) {
while (! $error && ! $timeout_passed && ! empty($bq->query)) {
$statement = $bq->extract(true);
if (! empty($statement)) {
$this->import->runQuery($statement, $statement, $sql_data);

View File

@ -768,18 +768,18 @@ class PdfRelationSchema extends ExportRelationSchema
$field_name,
$type,
$attribute,
(($row['Null'] == '' || $row['Null'] == 'NO')
($row['Null'] == '' || $row['Null'] == 'NO')
? __('No')
: __('Yes')),
(isset($row['Default']) ? $row['Default'] : ''),
: __('Yes'),
isset($row['Default']) ? $row['Default'] : '',
$row['Extra'],
$linksTo,
(isset($comments[$field_name])
isset($comments[$field_name])
? $comments[$field_name]
: ''),
(isset($mime_map) && isset($mime_map[$field_name])
: '',
isset($mime_map) && isset($mime_map[$field_name])
? str_replace('_', '/', $mime_map[$field_name]['mimetype'])
: ''),
: '',
];
$links = [];
$links[0] = $this->diagram->PMA_links['RT'][$table][$field_name];

View File

@ -101,7 +101,7 @@ class Text_Plain_Iptobinary extends IOTransformationsPlugin
. ' size="40"'
. ' dir="' . $text_dir . '"'
. ' class="' . $class . '"'
. ' id="field_' . ($idindex) . '_3"'
. ' id="field_' . $idindex . '_3"'
. ' tabindex="' . ($tabindex + $tabindex_for_value) . '">';
return $html;

View File

@ -91,7 +91,7 @@ class Relation
public function getRelationsParam()
{
if (empty($_SESSION['relation'][$GLOBALS['server']])
|| (empty($_SESSION['relation'][$GLOBALS['server']]['PMA_VERSION']))
|| empty($_SESSION['relation'][$GLOBALS['server']]['PMA_VERSION'])
|| $_SESSION['relation'][$GLOBALS['server']]['PMA_VERSION'] != PMA_VERSION
) {
$_SESSION['relation'][$GLOBALS['server']] = $this->checkRelationsParam();

View File

@ -748,7 +748,7 @@ class ReplicationGui
'',
mb_substr(
$_current_user,
(mb_strrpos($_current_user, '@') + 1)
mb_strrpos($_current_user, '@') + 1
)
);
if ($thishost != 'localhost' && $thishost != '127.0.0.1') {

View File

@ -125,12 +125,12 @@ class Footer
0 => [
'label' => __('OFF'),
'value' => "SET GLOBAL event_scheduler=\"OFF\"",
'selected' => ($es_state != 'on'),
'selected' => $es_state != 'on',
],
1 => [
'label' => __('ON'),
'value' => "SET GLOBAL event_scheduler=\"ON\"",
'selected' => ($es_state == 'on'),
'selected' => $es_state == 'on',
],
];
// Generate output

View File

@ -1599,7 +1599,7 @@ class Routines
echo $form;
}
exit;
} elseif (($response->isAjax())) {
} elseif ($response->isAjax()) {
$message = __('Error in processing request:') . ' ';
$message .= sprintf(
$this->words->get('not_found'),

View File

@ -782,12 +782,11 @@ class Privileges
'Does not require SSL-encrypted connections.'
),
'label' => 'REQUIRE NONE',
'checked' => (isset($row['ssl_type'])
'checked' => isset($row['ssl_type'])
&& ($row['ssl_type'] == 'NONE'
|| $row['ssl_type'] == '')
? 'checked="checked"'
: ''
),
: '',
'disabled' => false,
'radio' => true,
],
@ -798,10 +797,9 @@ class Privileges
'Requires SSL-encrypted connections.'
),
'label' => 'REQUIRE SSL',
'checked' => (isset($row['ssl_type']) && ($row['ssl_type'] == 'ANY')
'checked' => isset($row['ssl_type']) && ($row['ssl_type'] == 'ANY')
? 'checked="checked"'
: ''
),
: '',
'disabled' => false,
'radio' => true,
],
@ -812,10 +810,9 @@ class Privileges
'Requires a valid X509 certificate.'
),
'label' => 'REQUIRE X509',
'checked' => (isset($row['ssl_type']) && ($row['ssl_type'] == 'X509')
'checked' => isset($row['ssl_type']) && ($row['ssl_type'] == 'X509')
? 'checked="checked"'
: ''
),
: '',
'disabled' => false,
'radio' => true,
],
@ -824,15 +821,14 @@ class Privileges
'value' => 'SPECIFIED',
'description' => '',
'label' => 'SPECIFIED',
'checked' => ($specified ? 'checked="checked"' : ''),
'checked' => $specified ? 'checked="checked"' : '',
'disabled' => false,
'radio' => true,
],
[
'name' => 'ssl_cipher',
'value' => (isset($row['ssl_cipher'])
? htmlspecialchars($row['ssl_cipher']) : ''
),
'value' => isset($row['ssl_cipher'])
? htmlspecialchars($row['ssl_cipher']) : '',
'description' => __(
'Requires that a specific cipher method be used for a connection.'
),
@ -843,9 +839,8 @@ class Privileges
],
[
'name' => 'x509_issuer',
'value' => (isset($row['x509_issuer'])
? htmlspecialchars($row['x509_issuer']) : ''
),
'value' => isset($row['x509_issuer'])
? htmlspecialchars($row['x509_issuer']) : '',
'description' => __(
'Requires that a valid X509 certificate issued by this CA be presented.'
),
@ -856,9 +851,8 @@ class Privileges
],
[
'name' => 'x509_subject',
'value' => (isset($row['x509_subject'])
? htmlspecialchars($row['x509_subject']) : ''
),
'value' => isset($row['x509_subject'])
? htmlspecialchars($row['x509_subject']) : '',
'description' => __(
'Requires that a valid X509 certificate with this subject be presented.'
),
@ -887,7 +881,7 @@ class Privileges
[
'input_name' => 'max_questions',
'name_main' => 'MAX QUERIES PER HOUR',
'value' => (isset($row['max_questions']) ? $row['max_questions'] : '0'),
'value' => isset($row['max_questions']) ? $row['max_questions'] : '0',
'description' => __(
'Limits the number of queries the user may send to the server per hour.'
),
@ -895,7 +889,7 @@ class Privileges
[
'input_name' => 'max_updates',
'name_main' => 'MAX UPDATES PER HOUR',
'value' => (isset($row['max_updates']) ? $row['max_updates'] : '0'),
'value' => isset($row['max_updates']) ? $row['max_updates'] : '0',
'description' => __(
'Limits the number of commands that change any table '
. 'or database the user may execute per hour.'
@ -904,7 +898,7 @@ class Privileges
[
'input_name' => 'max_connections',
'name_main' => 'MAX CONNECTIONS PER HOUR',
'value' => (isset($row['max_connections']) ? $row['max_connections'] : '0'),
'value' => isset($row['max_connections']) ? $row['max_connections'] : '0',
'description' => __(
'Limits the number of new connections the user may open per hour.'
),
@ -912,8 +906,8 @@ class Privileges
[
'input_name' => 'max_user_connections',
'name_main' => 'MAX USER_CONNECTIONS',
'value' => (isset($row['max_user_connections']) ?
$row['max_user_connections'] : '0'),
'value' => isset($row['max_user_connections']) ?
$row['max_user_connections'] : '0',
'description' => __(
'Limits the number of simultaneous connections '
. 'the user may have.'
@ -1184,7 +1178,7 @@ class Privileges
. mb_substr(
$tmp_current_grant,
0,
(mb_strlen($tmp_current_grant) - 5)
mb_strlen($tmp_current_grant) - 5
);
$html_output .= (isset($GLOBALS[$privGlobalName])
? $GLOBALS[$privGlobalName]
@ -1340,10 +1334,9 @@ class Privileges
[
'Create',
'CREATE',
($table == '*'
$table == '*'
? __('Allows creating new databases and tables.')
: __('Allows creating new tables.')
),
: __('Allows creating new tables.'),
],
[
'Alter',
@ -1358,10 +1351,9 @@ class Privileges
[
'Drop',
'DROP',
($table == '*'
$table == '*'
? __('Allows dropping databases and tables.')
: __('Allows dropping tables.')
),
: __('Allows dropping tables.'),
],
[
'Create_tmp_table',
@ -1698,7 +1690,7 @@ class Privileges
'',
mb_substr(
$_current_user,
(mb_strrpos($_current_user, '@') + 1)
mb_strrpos($_current_user, '@') + 1
)
);
if ($thishost != 'localhost' && $thishost != '127.0.0.1') {
@ -3149,7 +3141,7 @@ class Privileges
}
$new_user_string .= '<td>';
if ((isset($_POST['Grant_priv']) && $_POST['Grant_priv'] == 'Y')) {
if (isset($_POST['Grant_priv']) && $_POST['Grant_priv'] == 'Y') {
$new_user_string .= __('Yes');
} else {
$new_user_string .= __('No');
@ -4336,7 +4328,7 @@ class Privileges
$_user_name = $this->dbi->fetchValue('SELECT USER()');
$hostname = mb_substr(
$_user_name,
(mb_strrpos($_user_name, '@') + 1)
mb_strrpos($_user_name, '@') + 1
);
unset($_user_name);
break;

View File

@ -206,7 +206,7 @@ class Data
];
$links['innodb']['doc'] = 'innodb';
return($links);
return $links;
}
/**

View File

@ -133,7 +133,7 @@ class Processes
: 'SHOW PROCESSLIST';
if ((! empty($_POST['order_by_field'])
&& ! empty($_POST['sort_order']))
|| (! empty($_POST['showExecuting']))
|| ! empty($_POST['showExecuting'])
) {
$sql_query = 'SELECT * FROM `INFORMATION_SCHEMA`.`PROCESSLIST` ';
}
@ -241,11 +241,11 @@ class Processes
$url_params = [
'ajax_request' => true,
'full' => (isset($_POST['full']) ? $_POST['full'] : ''),
'column_name' => (isset($_POST['column_name']) ? $_POST['column_name'] : ''),
'full' => isset($_POST['full']) ? $_POST['full'] : '',
'column_name' => isset($_POST['column_name']) ? $_POST['column_name'] : '',
'order_by_field'
=> (isset($_POST['order_by_field']) ? $_POST['order_by_field'] : ''),
'sort_order' => (isset($_POST['sort_order']) ? $_POST['sort_order'] : ''),
=> isset($_POST['order_by_field']) ? $_POST['order_by_field'] : '',
'sort_order' => isset($_POST['sort_order']) ? $_POST['sort_order'] : '',
];
$retval = '';
@ -280,7 +280,7 @@ class Processes
// Array keys need to modify due to the way it has used
// to display column values
if ((! empty($_POST['order_by_field']) && ! empty($_POST['sort_order']))
|| (! empty($_POST['showExecuting']))
|| ! empty($_POST['showExecuting'])
) {
foreach (array_keys($process) as $key) {
$new_key = ucfirst(mb_strtolower($key));

View File

@ -526,7 +526,7 @@ class Sql
&& $analyzed_sql_results['select_from']
&& isset($analyzed_sql_results['select_expr'])
&& isset($analyzed_sql_results['select_tables'])
&& ((empty($analyzed_sql_results['select_expr']))
&& (empty($analyzed_sql_results['select_expr'])
|| ((count($analyzed_sql_results['select_expr']) == 1)
&& ($analyzed_sql_results['select_expr'][0] == '*')))
&& count($analyzed_sql_results['select_tables']) == 1;
@ -979,7 +979,7 @@ class Sql
private function getNumberOfRowsAffectedOrChanged($is_affected, $result)
{
if (! $is_affected) {
$num_rows = ($result) ? @$GLOBALS['dbi']->numRows($result) : 0;
$num_rows = $result ? @$GLOBALS['dbi']->numRows($result) : 0;
} else {
$num_rows = @$GLOBALS['dbi']->affectedRows();
}

View File

@ -287,7 +287,7 @@ class Tracker
if ($result) {
// Deactivate previous version
self::deactivateTracking($dbname, $tablename, ($version - 1));
self::deactivateTracking($dbname, $tablename, $version - 1);
}
return $result;

View File

@ -80,7 +80,7 @@ class Tracking
}
$id++;
}
return($tmp_entries);
return $tmp_entries;
}
/**
@ -175,7 +175,7 @@ class Tracking
) {
$selectableTablesSqlResult = $this->getSqlResultForSelectableTables();
$selectableTablesEntries = [];
while (($entry = $GLOBALS['dbi']->fetchArray($selectableTablesSqlResult))) {
while ($entry = $GLOBALS['dbi']->fetchArray($selectableTablesSqlResult)) {
$entry['is_tracked'] = Tracker::isTracked(
$entry['db_name'],
$entry['table_name']
@ -649,7 +649,7 @@ class Tracking
$entry['url_params'] = Url::getCommon($urlParams + [
'report' => 'true',
'version' => $_POST['version'],
$deleteParam => ($lineNumber - $offset),
$deleteParam => $lineNumber - $offset,
], '');
$entry['line_number'] = $lineNumber;
$entries[] = $entry;
@ -1256,7 +1256,7 @@ class Tracking
$sep = $GLOBALS['cfg']['NavigationTreeTableSeparator'];
foreach ($table_list as $key => $value) {
if (is_array($value) && array_key_exists(('is' . $sep . 'group'), $value)
if (is_array($value) && array_key_exists('is' . $sep . 'group', $value)
&& $value['is' . $sep . 'group']
) {
$untracked_tables = array_merge($this->extractTableNames($value, $db), $untracked_tables); //Recursion step
@ -1299,12 +1299,12 @@ class Tracking
0 => [
'label' => __('not active'),
'value' => 'deactivate_now',
'selected' => ($state != 'active'),
'selected' => $state != 'active',
],
1 => [
'label' => __('active'),
'value' => 'activate_now',
'selected' => ($state == 'active'),
'selected' => $state == 'active',
],
];
$link = 'tbl_tracking.php' . $urlQuery . '&amp;table='

View File

@ -78,7 +78,7 @@ class UserPassword
$error = false;
$message = Message::success(__('The profile has been updated.'));
if (($_POST['nopass'] != '1')) {
if ($_POST['nopass'] != '1') {
if (strlen($_POST['pma_pw']) === 0 || strlen($_POST['pma_pw2']) === 0) {
$message = Message::error(__('The password is empty!'));
$error = true;

View File

@ -564,7 +564,7 @@ class Util
}
// Finding the query that failed, if not specified.
if ((empty($sql_query) && (! empty($GLOBALS['sql_query'])))) {
if (empty($sql_query) && ! empty($GLOBALS['sql_query'])) {
$sql_query = $GLOBALS['sql_query'];
}
$sql_query = trim($sql_query);
@ -599,7 +599,7 @@ class Util
// For security reasons, if the MySQL refuses the connection, the query
// is hidden so no details are revealed.
if ((! empty($sql_query)) && (! (mb_strstr($sql_query, 'connect')))) {
if (! empty($sql_query) && ! mb_strstr($sql_query, 'connect')) {
// Static analysis errors.
if (! empty($errors)) {
$error_msg .= '<p><strong>' . __('Static analysis:')
@ -1488,7 +1488,7 @@ class Util
if ($originalValue != 0 && floatval($value) == 0) {
return ' <' . number_format(
(1 / pow(10, $digits_right)),
1 / pow(10, $digits_right),
$digits_right,
$decimal_sep,
$thousands_sep
@ -1999,7 +1999,7 @@ class Util
if (! empty($analyzed_sql_results['statement']->expr)) {
foreach ($analyzed_sql_results['statement']->expr as $expr) {
if ((empty($expr->alias)) || (empty($expr->column))) {
if (empty($expr->alias) || empty($expr->column)) {
continue;
}
if (strcasecmp($meta->name, $expr->alias) == 0) {
@ -2130,7 +2130,7 @@ class Util
}
$where_clause = trim(preg_replace('|\s?AND$|', '', $preferred_condition));
return([$where_clause, $clause_is_unique, $condition_array]);
return [$where_clause, $clause_is_unique, $condition_array];
} // end function
/**
@ -4625,7 +4625,7 @@ class Util
$GLOBALS['dbi']->getTablesFull(
$db,
$groupWithSeparator,
($groupWithSeparator !== false),
$groupWithSeparator !== false,
$limit_offset,
$limit_count,
$sort,

View File

@ -57,7 +57,7 @@ class ZipExtension
if ($this->zip->numFiles === 0) {
$error_message = __('No files found inside ZIP archive!');
$this->zip->close();
return (['error' => $error_message, 'data' => $file_data]);
return ['error' => $error_message, 'data' => $file_data];
}
/* Is the the zip really an ODS file? */
@ -70,7 +70,7 @@ class ZipExtension
if (! isset($specific_entry)) {
$file_data = $first_zip_entry;
$this->zip->close();
return (['error' => $error_message, 'data' => $file_data]);
return ['error' => $error_message, 'data' => $file_data];
}
/* Return the correct contents, not just the first entry */
@ -88,11 +88,11 @@ class ZipExtension
}
$this->zip->close();
return (['error' => $error_message, 'data' => $file_data]);
return ['error' => $error_message, 'data' => $file_data];
} else {
$error_message = __('Error in ZIP archive:') . ' ' . $this->zip->getStatusString();
$this->zip->close();
return (['error' => $error_message, 'data' => $file_data]);
return ['error' => $error_message, 'data' => $file_data];
}
}

View File

@ -504,9 +504,8 @@ $html = $template->render('columns_definitions/column_definitions_form', [
'max_rows' => intval($GLOBALS['cfg']['MaxRows']),
'char_editing' => isset($GLOBALS['cfg']['CharEditing']) ? $GLOBALS['cfg']['CharEditing'] : null,
'attribute_types' => $GLOBALS['dbi']->types->getAttributes(),
'privs_available' => (isset($GLOBALS['col_priv']) ? $GLOBALS['col_priv'] : false
&& isset($GLOBALS['is_reload_priv']) ? $GLOBALS['is_reload_priv'] : false
),
'privs_available' => isset($GLOBALS['col_priv']) ? $GLOBALS['col_priv'] : false
&& isset($GLOBALS['is_reload_priv']) ? $GLOBALS['is_reload_priv'] : false,
'max_length' => $GLOBALS['dbi']->getVersion() >= 50503 ? 1024 : 255,
'have_partitioning' => Partition::havePartitioning(),
'dbi' => $GLOBALS['dbi'],

View File

@ -47,7 +47,7 @@ foreach (UserFormList::getAll() as $formset) {
'link' => 'prefs_forms.php',
'text' => $formset_class::getName(),
'icon' => $tabs_icons[$formset],
'active' => ($script_name == 'prefs_forms.php' && $formset == $form_param),
'active' => $script_name == 'prefs_forms.php' && $formset == $form_param,
];
$content .= Util::getHtmlTab($tab, ['form' => $formset]) . "\n";
}

View File

@ -56,14 +56,14 @@ $export_page_title = __('View dump (schema) of table');
if (! empty($sql_query)) {
$parser = new PhpMyAdmin\SqlParser\Parser($sql_query);
if ((! empty($parser->statements[0]))
if (! empty($parser->statements[0])
&& ($parser->statements[0] instanceof PhpMyAdmin\SqlParser\Statements\SelectStatement)
) {
// Finding aliases and removing them, but we keep track of them to be
// able to replace them in select expression too.
$aliases = [];
foreach ($parser->statements[0]->from as $from) {
if ((! empty($from->table)) && (! empty($from->alias))) {
if (! empty($from->table) && ! empty($from->alias)) {
$aliases[$from->alias] = $from->table;
// We remove the alias of the table because they are going to
// be replaced anyway.
@ -87,7 +87,7 @@ if (! empty($sql_query)) {
}
// Checking if the WHERE clause has to be replaced.
if ((! empty($where_clause)) && (is_array($where_clause))) {
if (! empty($where_clause) && is_array($where_clause)) {
$replaces[] = [
'WHERE',
'WHERE (' . implode(') OR (', $where_clause) . ')',

View File

@ -93,7 +93,7 @@ if ($pma_table->isEngine('ARIA')) {
$create_options['transactional'] = (isset($create_options['transactional']) && $create_options['transactional'] == '0')
? '0'
: '1';
$create_options['page_checksum'] = (isset($create_options['page_checksum'])) ? $create_options['page_checksum'] : '';
$create_options['page_checksum'] = isset($create_options['page_checksum']) ? $create_options['page_checksum'] : '';
}
$pma_table = $GLOBALS['dbi']->getTable(
@ -166,13 +166,13 @@ if (isset($_POST['submitoptions'])) {
$create_options['transactional'] = (isset($create_options['transactional']) && $create_options['transactional'] == '0')
? '0'
: '1';
$create_options['page_checksum'] = (isset($create_options['page_checksum'])) ? $create_options['page_checksum'] : '';
$create_options['page_checksum'] = isset($create_options['page_checksum']) ? $create_options['page_checksum'] : '';
}
} else {
$new_tbl_storage_engine = '';
}
$row_format = (isset($create_options['row_format']))
$row_format = isset($create_options['row_format'])
? $create_options['row_format']
: $pma_table->getRowFormat();
@ -180,7 +180,7 @@ if (isset($_POST['submitoptions'])) {
$pma_table,
$create_options['pack_keys'],
(empty($create_options['checksum']) ? '0' : '1'),
((isset($create_options['page_checksum'])) ? $create_options['page_checksum'] : ''),
(isset($create_options['page_checksum']) ? $create_options['page_checksum'] : ''),
(empty($create_options['delay_key_write']) ? '0' : '1'),
$row_format,
$new_tbl_storage_engine,
@ -388,7 +388,7 @@ $response->addHTML(
$auto_increment,
(empty($create_options['delay_key_write']) ? '0' : '1'),
((isset($create_options['transactional']) && $create_options['transactional'] == '0') ? '0' : '1'),
((isset($create_options['page_checksum'])) ? $create_options['page_checksum'] : ''),
(isset($create_options['page_checksum']) ? $create_options['page_checksum'] : ''),
(empty($create_options['checksum']) ? '0' : '1')
)
);

View File

@ -42,8 +42,8 @@ if (empty($versionDetails)) {
}
echo json_encode(
[
'version' => (! empty($version) ? $version : ''),
'date' => (! empty($date) ? $date : ''),
'version' => ! empty($version) ? $version : '',
'date' => ! empty($date) ? $date : '',
]
);
}