Remove useless parentheses
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
parent
27f0c05ce8
commit
dd2b05330a
@ -49,7 +49,7 @@ if ($routeInfo[0] === Dispatcher::NOT_FOUND) {
|
||||
$response->setHttpResponseCode(404);
|
||||
Message::error(sprintf(
|
||||
__('Error 404! The page %s was not found.'),
|
||||
'<code>' . ($route) . '</code>'
|
||||
'<code>' . $route . '</code>'
|
||||
))->display();
|
||||
} elseif ($routeInfo[0] === Dispatcher::METHOD_NOT_ALLOWED) {
|
||||
/** @var Response $response */
|
||||
|
||||
@ -1530,7 +1530,7 @@ class Config
|
||||
*/
|
||||
public function getCookieName(string $cookieName): string
|
||||
{
|
||||
return $cookieName . ( ($this->isHttps()) ? '_https' : '' );
|
||||
return $cookieName . ( $this->isHttps() ? '_https' : '' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -132,7 +132,7 @@ class Console
|
||||
*/
|
||||
public function getDisplay(): string
|
||||
{
|
||||
if ((! $this->_isAjax) && $this->_isEnabled) {
|
||||
if (! $this->_isAjax && $this->_isEnabled) {
|
||||
$cfgBookmark = Bookmark::getParams(
|
||||
$GLOBALS['cfg']['Server']['user']
|
||||
);
|
||||
|
||||
@ -81,7 +81,7 @@ class ErrorReportController extends AbstractController
|
||||
$_SESSION['prev_error_subm_time'] = time();
|
||||
$_SESSION['error_subm_count'] = (
|
||||
isset($_SESSION['error_subm_count'])
|
||||
? ($_SESSION['error_subm_count'] + 1)
|
||||
? $_SESSION['error_subm_count'] + 1
|
||||
: 0
|
||||
);
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ class GisDataEditorController extends AbstractController
|
||||
$gis_data['gis_type'] = mb_strtoupper($_POST['type']);
|
||||
}
|
||||
if (isset($_POST['value']) && trim($_POST['value']) != '') {
|
||||
$start = (substr($_POST['value'], 0, 1) == "'") ? 1 : 0;
|
||||
$start = substr($_POST['value'], 0, 1) == "'" ? 1 : 0;
|
||||
$gis_data['gis_type'] = mb_substr(
|
||||
$_POST['value'],
|
||||
$start,
|
||||
@ -77,7 +77,7 @@ class GisDataEditorController extends AbstractController
|
||||
}
|
||||
|
||||
// Generate Well Known Text
|
||||
$srid = (isset($gis_data['srid']) && $gis_data['srid'] != '') ? $gis_data['srid'] : 0;
|
||||
$srid = isset($gis_data['srid']) && $gis_data['srid'] != '' ? $gis_data['srid'] : 0;
|
||||
$wkt = $gis_obj->generateWkt($gis_data, 0);
|
||||
$wkt_with_zero = $gis_obj->generateWkt($gis_data, 0, '0');
|
||||
$result = "'" . $wkt . "'," . $srid;
|
||||
|
||||
@ -62,7 +62,7 @@ class ImportStatusController
|
||||
// reopen session
|
||||
session_start();
|
||||
|
||||
if ((time() - $timestamp) > $maximumTime) {
|
||||
if (time() - $timestamp > $maximumTime) {
|
||||
$_SESSION['Import_message']['message'] = Message::error(
|
||||
__('Could not load the progress of the import.')
|
||||
)->getDisplay();
|
||||
|
||||
@ -178,11 +178,11 @@ class VariablesController extends AbstractController
|
||||
// depends on Key_read_requests
|
||||
// normally lower then 1:0.01
|
||||
'Key_reads' => isset($this->data->status['Key_read_requests'])
|
||||
? (0.01 * $this->data->status['Key_read_requests']) : 0,
|
||||
? 0.01 * $this->data->status['Key_read_requests'] : 0,
|
||||
// depends on Key_write_requests
|
||||
// normally nearly 1:1
|
||||
'Key_writes' => isset($this->data->status['Key_write_requests'])
|
||||
? (0.9 * $this->data->status['Key_write_requests']) : 0,
|
||||
? 0.9 * $this->data->status['Key_write_requests'] : 0,
|
||||
|
||||
'Key_buffer_fraction' => 0.5,
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ class Common
|
||||
public function getTablesInfo(string $db = null, string $table = null): array
|
||||
{
|
||||
$designerTables = [];
|
||||
$db = ($db === null) ? $GLOBALS['db'] : $db;
|
||||
$db = $db === null ? $GLOBALS['db'] : $db;
|
||||
// seems to be needed later
|
||||
$this->dbi->selectDb($db);
|
||||
if ($db === null && $table === null) {
|
||||
@ -67,7 +67,7 @@ class Common
|
||||
foreach ($tables as $one_table) {
|
||||
$DF = $this->relation->getDisplayField($db, $one_table['TABLE_NAME']);
|
||||
$DF = is_string($DF) ? $DF : '';
|
||||
$DF = ($DF !== '') ? $DF : null;
|
||||
$DF = $DF !== '' ? $DF : null;
|
||||
$designerTables[] = new DesignerTable(
|
||||
$db,
|
||||
$one_table['TABLE_NAME'],
|
||||
@ -313,7 +313,7 @@ class Common
|
||||
DatabaseInterface::CONNECT_CONTROL,
|
||||
DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
return ( is_array($page_name) && isset($page_name[0]) ) ? $page_name[0] : null;
|
||||
return is_array($page_name) && isset($page_name[0]) ? $page_name[0] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -227,8 +227,8 @@ class Search
|
||||
$allColumns = $this->dbi->getColumns($GLOBALS['db'], $table);
|
||||
$likeClauses = [];
|
||||
// Based on search type, decide like/regex & '%'/''
|
||||
$like_or_regex = (($this->criteriaSearchType == 5) ? 'REGEXP' : 'LIKE');
|
||||
$automatic_wildcard = (($this->criteriaSearchType < 4) ? '%' : '');
|
||||
$like_or_regex = ($this->criteriaSearchType == 5 ? 'REGEXP' : 'LIKE');
|
||||
$automatic_wildcard = ($this->criteriaSearchType < 4 ? '%' : '');
|
||||
// For "as regular expression" (search option 5), LIKE won't be used
|
||||
// Usage example: If user is searching for a literal $ in a regexp search,
|
||||
// they should enter \$ as the value.
|
||||
@ -236,9 +236,9 @@ class Search
|
||||
$this->criteriaSearchString
|
||||
);
|
||||
// Extract search words or pattern
|
||||
$search_words = (($this->criteriaSearchType > 2)
|
||||
$search_words = $this->criteriaSearchType > 2
|
||||
? [$criteriaSearchStringEscaped]
|
||||
: explode(' ', $criteriaSearchStringEscaped));
|
||||
: explode(' ', $criteriaSearchStringEscaped);
|
||||
|
||||
foreach ($search_words as $search_word) {
|
||||
// Eliminates empty values
|
||||
|
||||
@ -1685,7 +1685,7 @@ class DatabaseInterface implements DbalInterface
|
||||
|
||||
// return false if result is empty or false
|
||||
// or requested row is larger than rows in result
|
||||
if ($this->numRows($result) < ($row_number + 1)) {
|
||||
if ($this->numRows($result) < $row_number + 1) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
@ -1009,10 +1009,10 @@ class Results
|
||||
$buttons_html .= $this->_getTableNavigationButton(
|
||||
'>>',
|
||||
_pgettext('Last page', 'End'),
|
||||
@((ceil(
|
||||
@(ceil(
|
||||
$this->__get('unlim_num_rows')
|
||||
/ $_SESSION['tmpval']['max_rows']
|
||||
) - 1) * $maxRows),
|
||||
) - 1) * $maxRows,
|
||||
$html_sql_query,
|
||||
false,
|
||||
$onsubmit,
|
||||
@ -2491,7 +2491,7 @@ class Results
|
||||
while ($row = $GLOBALS['dbi']->fetchRow($dt_result)) {
|
||||
// add repeating headers
|
||||
if (($row_no != 0) && ($_SESSION['tmpval']['repeat_cells'] != 0)
|
||||
&& ! ($row_no % $_SESSION['tmpval']['repeat_cells'])
|
||||
&& ! $row_no % $_SESSION['tmpval']['repeat_cells']
|
||||
) {
|
||||
$table_body_html .= $this->_getRepeatingHeaders(
|
||||
$display_params
|
||||
|
||||
@ -731,7 +731,7 @@ class Export
|
||||
|
||||
$size = $this->dbi->fetchValue($query);
|
||||
//Converting the size to MB
|
||||
$size = ($size / 1024) / 1024;
|
||||
$size = $size / 1024 / 1024;
|
||||
if ($size > $table_size) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -194,14 +194,14 @@ class Font
|
||||
$count = 0;
|
||||
|
||||
foreach ($charLists as $charList) {
|
||||
$count += ((mb_strlen($text)
|
||||
$count += (mb_strlen($text)
|
||||
- mb_strlen(str_replace($charList['chars'], '', $text))
|
||||
) * $charList['modifier']);
|
||||
) * $charList['modifier'];
|
||||
}
|
||||
|
||||
$text = str_replace(' ', '', $text);//remove the " "'s
|
||||
//all other chars
|
||||
$count += (mb_strlen(preg_replace('/[a-z0-9]/i', '', $text)) * 0.3);
|
||||
$count += mb_strlen(preg_replace('/[a-z0-9]/i', '', $text)) * 0.3;
|
||||
|
||||
$modifier = 1;
|
||||
$font = mb_strtolower($font);
|
||||
|
||||
@ -296,11 +296,11 @@ class GisLineString extends GisGeometry
|
||||
}
|
||||
$wkt = 'LINESTRING(';
|
||||
for ($i = 0; $i < $no_of_points; $i++) {
|
||||
$wkt .= ((isset($gis_data[$index]['LINESTRING'][$i]['x'])
|
||||
&& trim((string) $gis_data[$index]['LINESTRING'][$i]['x']) != '')
|
||||
$wkt .= (isset($gis_data[$index]['LINESTRING'][$i]['x'])
|
||||
&& trim((string) $gis_data[$index]['LINESTRING'][$i]['x']) != ''
|
||||
? $gis_data[$index]['LINESTRING'][$i]['x'] : $empty)
|
||||
. ' ' . ((isset($gis_data[$index]['LINESTRING'][$i]['y'])
|
||||
&& trim((string) $gis_data[$index]['LINESTRING'][$i]['y']) != '')
|
||||
. ' ' . (isset($gis_data[$index]['LINESTRING'][$i]['y'])
|
||||
&& trim((string) $gis_data[$index]['LINESTRING'][$i]['y']) != ''
|
||||
? $gis_data[$index]['LINESTRING'][$i]['y'] : $empty) . ',';
|
||||
}
|
||||
|
||||
|
||||
@ -335,11 +335,11 @@ class GisMultiLineString extends GisGeometry
|
||||
}
|
||||
$wkt .= '(';
|
||||
for ($j = 0; $j < $no_of_points; $j++) {
|
||||
$wkt .= ((isset($data_row[$i][$j]['x'])
|
||||
&& trim((string) $data_row[$i][$j]['x']) != '')
|
||||
$wkt .= (isset($data_row[$i][$j]['x'])
|
||||
&& trim((string) $data_row[$i][$j]['x']) != ''
|
||||
? $data_row[$i][$j]['x'] : $empty)
|
||||
. ' ' . ((isset($data_row[$i][$j]['y'])
|
||||
&& trim((string) $data_row[$i][$j]['y']) != '')
|
||||
. ' ' . (isset($data_row[$i][$j]['y'])
|
||||
&& trim((string) $data_row[$i][$j]['y']) != ''
|
||||
? $data_row[$i][$j]['y'] : $empty) . ',';
|
||||
}
|
||||
$wkt
|
||||
|
||||
@ -297,11 +297,11 @@ class GisMultiPoint extends GisGeometry
|
||||
}
|
||||
$wkt = 'MULTIPOINT(';
|
||||
for ($i = 0; $i < $no_of_points; $i++) {
|
||||
$wkt .= ((isset($gis_data[$index]['MULTIPOINT'][$i]['x'])
|
||||
&& trim((string) $gis_data[$index]['MULTIPOINT'][$i]['x']) != '')
|
||||
$wkt .= (isset($gis_data[$index]['MULTIPOINT'][$i]['x'])
|
||||
&& trim((string) $gis_data[$index]['MULTIPOINT'][$i]['x']) != ''
|
||||
? $gis_data[$index]['MULTIPOINT'][$i]['x'] : '')
|
||||
. ' ' . ((isset($gis_data[$index]['MULTIPOINT'][$i]['y'])
|
||||
&& trim((string) $gis_data[$index]['MULTIPOINT'][$i]['y']) != '')
|
||||
. ' ' . (isset($gis_data[$index]['MULTIPOINT'][$i]['y'])
|
||||
&& trim((string) $gis_data[$index]['MULTIPOINT'][$i]['y']) != ''
|
||||
? $gis_data[$index]['MULTIPOINT'][$i]['y'] : '') . ',';
|
||||
}
|
||||
|
||||
|
||||
@ -406,11 +406,11 @@ class GisMultiPolygon extends GisGeometry
|
||||
}
|
||||
$wkt .= '(';
|
||||
for ($j = 0; $j < $no_of_points; $j++) {
|
||||
$wkt .= ((isset($data_row[$k][$i][$j]['x'])
|
||||
&& trim((string) $data_row[$k][$i][$j]['x']) != '')
|
||||
$wkt .= (isset($data_row[$k][$i][$j]['x'])
|
||||
&& trim((string) $data_row[$k][$i][$j]['x']) != ''
|
||||
? $data_row[$k][$i][$j]['x'] : $empty)
|
||||
. ' ' . ((isset($data_row[$k][$i][$j]['y'])
|
||||
&& trim((string) $data_row[$k][$i][$j]['y']) != '')
|
||||
. ' ' . (isset($data_row[$k][$i][$j]['y'])
|
||||
&& trim((string) $data_row[$k][$i][$j]['y']) != ''
|
||||
? $data_row[$k][$i][$j]['y'] : $empty) . ',';
|
||||
}
|
||||
$wkt
|
||||
|
||||
@ -300,12 +300,12 @@ class GisPoint extends GisGeometry
|
||||
public function generateWkt(array $gis_data, $index, $empty = '')
|
||||
{
|
||||
return 'POINT('
|
||||
. ((isset($gis_data[$index]['POINT']['x'])
|
||||
&& trim((string) $gis_data[$index]['POINT']['x']) != '')
|
||||
. (isset($gis_data[$index]['POINT']['x'])
|
||||
&& trim((string) $gis_data[$index]['POINT']['x']) != ''
|
||||
? $gis_data[$index]['POINT']['x'] : '')
|
||||
. ' '
|
||||
. ((isset($gis_data[$index]['POINT']['y'])
|
||||
&& trim((string) $gis_data[$index]['POINT']['y']) != '')
|
||||
. (isset($gis_data[$index]['POINT']['y'])
|
||||
&& trim((string) $gis_data[$index]['POINT']['y']) != ''
|
||||
? $gis_data[$index]['POINT']['y'] : '') . ')';
|
||||
}
|
||||
|
||||
|
||||
@ -357,11 +357,11 @@ class GisPolygon extends GisGeometry
|
||||
}
|
||||
$wkt .= '(';
|
||||
for ($j = 0; $j < $no_of_points; $j++) {
|
||||
$wkt .= ((isset($gis_data[$index]['POLYGON'][$i][$j]['x'])
|
||||
&& trim((string) $gis_data[$index]['POLYGON'][$i][$j]['x']) != '')
|
||||
$wkt .= (isset($gis_data[$index]['POLYGON'][$i][$j]['x'])
|
||||
&& trim((string) $gis_data[$index]['POLYGON'][$i][$j]['x']) != ''
|
||||
? $gis_data[$index]['POLYGON'][$i][$j]['x'] : $empty)
|
||||
. ' ' . ((isset($gis_data[$index]['POLYGON'][$i][$j]['y'])
|
||||
&& trim((string) $gis_data[$index]['POLYGON'][$i][$j]['y']) != '')
|
||||
. ' ' . (isset($gis_data[$index]['POLYGON'][$i][$j]['y'])
|
||||
&& trim((string) $gis_data[$index]['POLYGON'][$i][$j]['y']) != ''
|
||||
? $gis_data[$index]['POLYGON'][$i][$j]['y'] : $empty) . ',';
|
||||
}
|
||||
$wkt
|
||||
|
||||
@ -341,7 +341,7 @@ class GisVisualization
|
||||
{
|
||||
$img = $this->_svg();
|
||||
$this->_toFile($file_name, 'image/svg+xml', 'svg');
|
||||
echo($img);
|
||||
echo$img;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -606,9 +606,9 @@ class GisVisualization
|
||||
// scale the visualization
|
||||
$x_ratio = ($min_max['maxX'] - $min_max['minX']) / $plot_width;
|
||||
$y_ratio = ($min_max['maxY'] - $min_max['minY']) / $plot_height;
|
||||
$ratio = ($x_ratio > $y_ratio) ? $x_ratio : $y_ratio;
|
||||
$ratio = $x_ratio > $y_ratio ? $x_ratio : $y_ratio;
|
||||
|
||||
$scale = ($ratio != 0) ? (1 / $ratio) : 1;
|
||||
$scale = $ratio != 0 ? 1 / $ratio : 1;
|
||||
|
||||
if ($x_ratio < $y_ratio) {
|
||||
// center horizontally
|
||||
|
||||
@ -54,7 +54,7 @@ class DropDownUploadFileBlock implements FieldGenerator
|
||||
$matcher = '@\.(' . $extensions . ')(\.('
|
||||
. $fileListing->supportedDecompressions() . '))?$@';
|
||||
|
||||
$active = (isset($GLOBALS['timeout_passed'], $GLOBALS['local_import_file']) && $GLOBALS['timeout_passed'])
|
||||
$active = isset($GLOBALS['timeout_passed'], $GLOBALS['local_import_file']) && $GLOBALS['timeout_passed']
|
||||
? $GLOBALS['local_import_file']
|
||||
: '';
|
||||
|
||||
|
||||
@ -324,7 +324,7 @@ class Generator
|
||||
'div_for_slider_effect',
|
||||
[
|
||||
'id' => $id,
|
||||
'initial_sliders_state' => ($overrideDefault != null) ? $overrideDefault
|
||||
'initial_sliders_state' => $overrideDefault != null ? $overrideDefault
|
||||
: $GLOBALS['cfg']['InitialSlidersState'],
|
||||
'message' => $message,
|
||||
]
|
||||
@ -658,7 +658,7 @@ class Generator
|
||||
$pos = $_SESSION['tmpval']['pos'];
|
||||
} else {
|
||||
$number_of_line = (int) $_REQUEST['unlim_num_rows'];
|
||||
$pos = ((ceil($number_of_line / $rows) - 1) * $rows);
|
||||
$pos = (ceil($number_of_line / $rows) - 1) * $rows;
|
||||
$_SESSION['tmpval']['pos'] = $pos;
|
||||
}
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ class Import
|
||||
} elseif ($timeout_passed) {
|
||||
return true;
|
||||
/* 5 in next row might be too much */
|
||||
} elseif ((time() - $timestamp) > ($maximum_time - 5)) {
|
||||
} elseif (time() - $timestamp > $maximum_time - 5) {
|
||||
$timeout_passed = true;
|
||||
return true;
|
||||
}
|
||||
@ -472,10 +472,10 @@ class Import
|
||||
if ($num == 0) {
|
||||
// use 'Z' if column number is 0,
|
||||
// this is necessary because A-Z has no 'zero'
|
||||
$col_name .= mb_chr(($A + 26) - 1);
|
||||
$col_name .= mb_chr($A + 26 - 1);
|
||||
} else {
|
||||
// convert column number to ASCII character
|
||||
$col_name .= mb_chr(($A + $num) - 1);
|
||||
$col_name .= mb_chr($A + $num - 1);
|
||||
}
|
||||
|
||||
return $col_name;
|
||||
@ -506,7 +506,7 @@ class Import
|
||||
$column_number = 0;
|
||||
for ($i = 0; $i < $num_chars; ++$i) {
|
||||
// read string from back to front
|
||||
$char_pos = ($num_chars - 1) - $i;
|
||||
$char_pos = $num_chars - 1 - $i;
|
||||
|
||||
// convert capital character to ASCII value
|
||||
// and subtract 64 to get corresponding decimal value
|
||||
@ -570,7 +570,7 @@ class Import
|
||||
{
|
||||
$curr_size = mb_strlen($cell);
|
||||
$decPos = mb_strpos($cell, '.');
|
||||
$decPrecision = ($curr_size - 1) - $decPos;
|
||||
$decPrecision = $curr_size - 1 - $decPos;
|
||||
|
||||
$m = $curr_size - 1;
|
||||
$d = $decPrecision;
|
||||
@ -686,8 +686,8 @@ class Import
|
||||
/* New val if M or D is greater than current largest */
|
||||
if ($size[self::M] > $oldM || $size[self::D] > $oldD) {
|
||||
/* Take the largest of both types */
|
||||
return (string) ((($size[self::M] > $oldM) ? $size[self::M] : $oldM)
|
||||
. ',' . (($size[self::D] > $oldD) ? $size[self::D] : $oldD));
|
||||
return (string) (($size[self::M] > $oldM ? $size[self::M] : $oldM)
|
||||
. ',' . ($size[self::D] > $oldD ? $size[self::D] : $oldD));
|
||||
}
|
||||
|
||||
return $last_cumulative_size;
|
||||
@ -1080,7 +1080,7 @@ class Import
|
||||
$tempSQLStr .= '(' . $size . ')';
|
||||
}
|
||||
|
||||
if ($j != (count($tables[$i][self::COL_NAMES]) - 1)) {
|
||||
if ($j != count($tables[$i][self::COL_NAMES]) - 1) {
|
||||
$tempSQLStr .= ', ';
|
||||
}
|
||||
}
|
||||
@ -1114,7 +1114,7 @@ class Import
|
||||
for ($m = 0; $m < $num_cols; ++$m) {
|
||||
$tempSQLStr .= Util::backquote($tables[$i][self::COL_NAMES][$m]);
|
||||
|
||||
if ($m != ($num_cols - 1)) {
|
||||
if ($m != $num_cols - 1) {
|
||||
$tempSQLStr .= ', ';
|
||||
}
|
||||
}
|
||||
@ -1151,11 +1151,11 @@ class Import
|
||||
$tempSQLStr .= $is_varchar ? "'" : '';
|
||||
}
|
||||
|
||||
if ($k != ($num_cols - 1)) {
|
||||
if ($k != $num_cols - 1) {
|
||||
$tempSQLStr .= ', ';
|
||||
}
|
||||
|
||||
if ($col_count == ($num_cols - 1)) {
|
||||
if ($col_count == $num_cols - 1) {
|
||||
$col_count = 0;
|
||||
} else {
|
||||
$col_count++;
|
||||
@ -1167,7 +1167,7 @@ class Import
|
||||
|
||||
$tempSQLStr .= ')';
|
||||
|
||||
if ($j != ($num_rows - 1)) {
|
||||
if ($j != $num_rows - 1) {
|
||||
$tempSQLStr .= ",\n ";
|
||||
}
|
||||
|
||||
|
||||
@ -199,7 +199,7 @@ class IpAllowDeny
|
||||
$origval = hexdec($orig);
|
||||
|
||||
// OR it with (2^flexbits)-1, with flexbits limited to 4 at a time
|
||||
$newval = $origval | (pow(2, min(4, $flexbits)) - 1);
|
||||
$newval = $origval | pow(2, min(4, $flexbits)) - 1;
|
||||
|
||||
// Convert it back to a hexadecimal character
|
||||
$new = dechex($newval);
|
||||
|
||||
@ -51,7 +51,7 @@ class Linter
|
||||
// first byte of the third character. The fourth and the last one
|
||||
// (which is actually a new line) aren't going to be processed at
|
||||
// all.
|
||||
$len = ($str instanceof UtfString) ?
|
||||
$len = $str instanceof UtfString ?
|
||||
$str->length() : strlen($str);
|
||||
|
||||
$lines = [0];
|
||||
|
||||
@ -1321,7 +1321,7 @@ class Operations
|
||||
* old versions of MySQL/MariaDB must be returning something or not empty.
|
||||
* This patch is to support newer MySQL/MariaDB while also for backward compatibilities.
|
||||
*/
|
||||
if (( ('Barracuda' == $innodb_file_format) || ($innodb_file_format == '') )
|
||||
if (('Barracuda' == $innodb_file_format) || ($innodb_file_format == '')
|
||||
&& $innodbEnginePlugin->supportsFilePerTable()
|
||||
) {
|
||||
$possible_row_formats['INNODB']['DYNAMIC'] = 'DYNAMIC';
|
||||
|
||||
@ -653,7 +653,7 @@ class ExportHtmlword extends ExportPlugin
|
||||
. htmlspecialchars($col_alias) . $fmt_post . '</td>';
|
||||
$definition .= '<td class="print">' . htmlspecialchars($type) . '</td>';
|
||||
$definition .= '<td class="print">'
|
||||
. (($column['Null'] == '' || $column['Null'] == 'NO')
|
||||
. ($column['Null'] == '' || $column['Null'] == 'NO'
|
||||
? __('No')
|
||||
: __('Yes'))
|
||||
. '</td>';
|
||||
|
||||
@ -419,7 +419,7 @@ class ExportLatex extends ExportPlugin
|
||||
}
|
||||
|
||||
// last column ... no need for & character
|
||||
if ($i == ($columns_cnt - 1)) {
|
||||
if ($i == $columns_cnt - 1) {
|
||||
$buffer .= $column_value;
|
||||
} else {
|
||||
$buffer .= $column_value . ' & ';
|
||||
@ -617,7 +617,7 @@ class ExportLatex extends ExportPlugin
|
||||
}
|
||||
|
||||
$local_buffer = $col_as . "\000" . $type . "\000"
|
||||
. (($row['Null'] == '' || $row['Null'] == 'NO')
|
||||
. ($row['Null'] == '' || $row['Null'] == 'NO'
|
||||
? __('No') : __('Yes'))
|
||||
. "\000" . ($row['Default'] ?? '');
|
||||
|
||||
|
||||
@ -790,7 +790,7 @@ class ExportOdt extends ExportPlugin
|
||||
}
|
||||
$definition .= '<table:table-cell office:value-type="string">'
|
||||
. '<text:p>'
|
||||
. (($column['Null'] == '' || $column['Null'] == 'NO')
|
||||
. ($column['Null'] == '' || $column['Null'] == 'NO'
|
||||
? __('No')
|
||||
: __('Yes'))
|
||||
. '</text:p>'
|
||||
|
||||
@ -239,7 +239,7 @@ class ExportPhparray extends ExportPlugin
|
||||
for ($i = 0; $i < $columns_cnt; $i++) {
|
||||
$buffer .= var_export($columns[$i], true)
|
||||
. ' => ' . var_export($record[$i], true)
|
||||
. (($i + 1 >= $columns_cnt) ? '' : ',');
|
||||
. ($i + 1 >= $columns_cnt ? '' : ',');
|
||||
}
|
||||
|
||||
$buffer .= ')';
|
||||
|
||||
@ -608,7 +608,7 @@ class ExportTexytext extends ExportPlugin
|
||||
. $fmt_pre . htmlspecialchars($col_alias) . $fmt_post;
|
||||
$definition .= '|' . htmlspecialchars($type);
|
||||
$definition .= '|'
|
||||
. (($column['Null'] == '' || $column['Null'] == 'NO')
|
||||
. ($column['Null'] == '' || $column['Null'] == 'NO'
|
||||
? __('No') : __('Yes'));
|
||||
$definition .= '|'
|
||||
. htmlspecialchars(
|
||||
|
||||
@ -110,7 +110,7 @@ class Pdf extends PdfLib
|
||||
$y = $this->y;
|
||||
}
|
||||
$current_page = $this->page;
|
||||
if ((($y + $h) > $this->PageBreakTrigger)
|
||||
if (($y + $h > $this->PageBreakTrigger)
|
||||
&& (! $this->InFooter)
|
||||
&& $this->AcceptPageBreak()
|
||||
) {
|
||||
@ -133,7 +133,7 @@ class Pdf extends PdfLib
|
||||
}
|
||||
} else {
|
||||
if ($this_page_olm != $old_page_olm) {
|
||||
$this->x = $x + ($this_page_olm - $old_page_olm);
|
||||
$this->x = $x + $this_page_olm - $old_page_olm;
|
||||
} else {
|
||||
$this->x = $x;
|
||||
}
|
||||
@ -785,7 +785,7 @@ class Pdf extends PdfLib
|
||||
// enlarge the column (but avoid enlarging it if the
|
||||
// data's width is very big)
|
||||
if ($stringWidth > $val
|
||||
&& $stringWidth < ($this->sColWidth * 3)
|
||||
&& $stringWidth < $this->sColWidth * 3
|
||||
) {
|
||||
$colFits[$key] = $stringWidth;
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ class TableProperty
|
||||
*/
|
||||
public function isUnique(): string
|
||||
{
|
||||
return ($this->key === 'PRI' || $this->key === 'UNI') ? 'true' : 'false';
|
||||
return $this->key === 'PRI' || $this->key === 'UNI' ? 'true' : 'false';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -141,7 +141,7 @@ class ImportLdi extends AbstractImportCsv
|
||||
if (strlen((string) $ldi_new_line) > 0) {
|
||||
if ($ldi_new_line == 'auto') {
|
||||
$ldi_new_line
|
||||
= (PHP_EOL == "\n")
|
||||
= PHP_EOL == "\n"
|
||||
? '\n'
|
||||
: '\r\n';
|
||||
}
|
||||
|
||||
@ -125,7 +125,7 @@ class ImportSql extends ImportPlugin
|
||||
*/
|
||||
$GLOBALS['finished'] = false;
|
||||
|
||||
while ((! $error) && (! $timeout_passed)) {
|
||||
while (! $error && (! $timeout_passed)) {
|
||||
// Getting the first statement, the remaining data and the last
|
||||
// delimiter.
|
||||
$statement = $bq->extract();
|
||||
|
||||
@ -764,7 +764,7 @@ class PdfRelationSchema extends ExportRelationSchema
|
||||
$field_name,
|
||||
$type,
|
||||
$attribute,
|
||||
($row['Null'] == '' || $row['Null'] == 'NO')
|
||||
$row['Null'] == '' || $row['Null'] == 'NO'
|
||||
? __('No')
|
||||
: __('Yes'),
|
||||
$row['Default'] ?? '',
|
||||
|
||||
@ -103,7 +103,7 @@ class RelationStatsPdf extends RelationStats
|
||||
],
|
||||
];
|
||||
list ($a, $b, $c) = $case[$d];
|
||||
$e = (1 - ($j - 1) / 6);
|
||||
$e = 1 - ($j - 1) / 6;
|
||||
$this->diagram->SetDrawColor($a * 255 * $e, $b * 255 * $e, $c * 255 * $e);
|
||||
} else {
|
||||
$this->diagram->SetDrawColor(0);
|
||||
|
||||
@ -69,7 +69,7 @@ abstract class SubstringTransformationsPlugin extends TransformationsPlugin
|
||||
$newtext = $options[2] . $newtext;
|
||||
}
|
||||
|
||||
if (($length + (int) $options[0]) != $baselength) {
|
||||
if ($length + (int) $options[0] != $baselength) {
|
||||
$newtext .= $options[2];
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ abstract class TextLinkTransformationsPlugin extends TransformationsPlugin
|
||||
{
|
||||
$cfg = $GLOBALS['cfg'];
|
||||
$options = $this->getOptions($options, $cfg['DefaultTransformations']['TextLink']);
|
||||
$url = ($options[0] ?? '') . ((isset($options[2]) && $options[2]) ? '' : $buffer);
|
||||
$url = ($options[0] ?? '') . (isset($options[2]) && $options[2] ? '' : $buffer);
|
||||
/* Do not allow javascript links */
|
||||
if (! Sanitize::checkLink($url, true, true)) {
|
||||
return htmlspecialchars($url);
|
||||
|
||||
@ -1244,7 +1244,7 @@ class Routines
|
||||
);
|
||||
}
|
||||
}
|
||||
if ($i != (count($item_param_name) - 1)) {
|
||||
if ($i != count($item_param_name) - 1) {
|
||||
$params .= ', ';
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -26,7 +26,7 @@ class ConfigGenerator
|
||||
*/
|
||||
public static function getConfigFile(ConfigFile $cf)
|
||||
{
|
||||
$crlf = (isset($_SESSION['eol']) && $_SESSION['eol'] == 'win')
|
||||
$crlf = isset($_SESSION['eol']) && $_SESSION['eol'] == 'win'
|
||||
? "\r\n"
|
||||
: "\n";
|
||||
$conf = $cf->getConfig();
|
||||
|
||||
@ -438,7 +438,7 @@ class Sql
|
||||
);
|
||||
|
||||
$selected_values = explode(',', $converted_curr_value);
|
||||
$select_size = (count($values) > 10) ? 10 : count($values);
|
||||
$select_size = count($values) > 10 ? 10 : count($values);
|
||||
|
||||
return $this->template->render('sql/set_column', [
|
||||
'size' => $select_size,
|
||||
@ -2299,7 +2299,7 @@ class Sql
|
||||
$max_rows = $_SESSION['tmpval']['max_rows'];
|
||||
}
|
||||
|
||||
return @((ceil($number_of_line / $max_rows) - 1) * $max_rows);
|
||||
return @(ceil($number_of_line / $max_rows) - 1) * $max_rows;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -129,6 +129,6 @@ class SystemDatabase
|
||||
}
|
||||
}
|
||||
|
||||
return ($column_count > 0) ? $new_transformations_sql : '';
|
||||
return $column_count > 0 ? $new_transformations_sql : '';
|
||||
}
|
||||
}
|
||||
|
||||
@ -454,7 +454,7 @@ class Table
|
||||
}
|
||||
}
|
||||
// we need explicit DEFAULT value here (different from '0')
|
||||
$create_options['pack_keys'] = (! isset($create_options['pack_keys']) || strlen($create_options['pack_keys']) == 0)
|
||||
$create_options['pack_keys'] = ! isset($create_options['pack_keys']) || strlen($create_options['pack_keys']) == 0
|
||||
? 'DEFAULT'
|
||||
: $create_options['pack_keys'];
|
||||
return $create_options;
|
||||
|
||||
@ -132,14 +132,14 @@ class UserPassword
|
||||
}
|
||||
|
||||
$sql_query = 'SET password = '
|
||||
. (($password == '') ? '\'\'' : $hashing_function . '(\'***\')');
|
||||
. ($password == '' ? '\'\'' : $hashing_function . '(\'***\')');
|
||||
|
||||
if ($serverType == 'MySQL'
|
||||
&& $serverVersion >= 50706
|
||||
) {
|
||||
$sql_query = 'ALTER USER \'' . $username . '\'@\'' . $hostname
|
||||
. '\' IDENTIFIED WITH ' . $orig_auth_plugin . ' BY '
|
||||
. (($password == '') ? '\'\'' : '\'***\'');
|
||||
. ($password == '' ? '\'\'' : '\'***\'');
|
||||
} elseif (($serverType == 'MySQL'
|
||||
&& $serverVersion >= 50507)
|
||||
|| ($serverType == 'MariaDB'
|
||||
@ -218,7 +218,7 @@ class UserPassword
|
||||
if ($serverType == 'MySQL' && $serverVersion >= 50706) {
|
||||
$local_query = 'ALTER USER \'' . $username . '\'@\'' . $hostname . '\''
|
||||
. ' IDENTIFIED with ' . $orig_auth_plugin . ' BY '
|
||||
. (($password == '')
|
||||
. ($password == ''
|
||||
? '\'\''
|
||||
: '\'' . $GLOBALS['dbi']->escapeString($password) . '\'');
|
||||
} elseif ($serverType == 'MariaDB'
|
||||
@ -245,7 +245,7 @@ class UserPassword
|
||||
. " WHERE `User` = '" . $username . "' AND Host = '"
|
||||
. $hostname . "';";
|
||||
} else {
|
||||
$local_query = 'SET password = ' . (($password == '')
|
||||
$local_query = 'SET password = ' . ($password == ''
|
||||
? '\'\''
|
||||
: $hashing_function . '(\''
|
||||
. $GLOBALS['dbi']->escapeString($password) . '\')');
|
||||
|
||||
@ -954,7 +954,7 @@ class Util
|
||||
&& ($meta->type != 'real')
|
||||
) {
|
||||
$con_val = '= ' . $row[$i];
|
||||
} elseif ((($meta->type == 'blob') || ($meta->type == 'string'))
|
||||
} elseif (($meta->type == 'blob') || ($meta->type == 'string')
|
||||
&& false !== stripos($field_flags, 'BINARY')
|
||||
&& ! empty($row[$i])
|
||||
) {
|
||||
@ -1088,8 +1088,8 @@ class Util
|
||||
$prompt = ''
|
||||
) {
|
||||
$increment = floor($nbTotalPage / $percent);
|
||||
$pageNowMinusRange = ($pageNow - $range);
|
||||
$pageNowPlusRange = ($pageNow + $range);
|
||||
$pageNowMinusRange = $pageNow - $range;
|
||||
$pageNowPlusRange = $pageNow + $range;
|
||||
|
||||
$gotopage = $prompt . ' <select class="pageselector ajax"';
|
||||
|
||||
@ -1782,7 +1782,7 @@ class Util
|
||||
if (isset($escape_class, $escape_method)) {
|
||||
$replace[$key] = $escape_class->$escape_method($val);
|
||||
} else {
|
||||
$replace[$key] = ($escape == 'backquote')
|
||||
$replace[$key] = $escape == 'backquote'
|
||||
? self::$escape($val)
|
||||
: $escape($val);
|
||||
}
|
||||
@ -1903,7 +1903,7 @@ class Util
|
||||
*/
|
||||
public static function createGISData($gis_string, $mysqlVersion)
|
||||
{
|
||||
$geomFromText = ($mysqlVersion >= 50600) ? 'ST_GeomFromText' : 'GeomFromText';
|
||||
$geomFromText = $mysqlVersion >= 50600 ? 'ST_GeomFromText' : 'GeomFromText';
|
||||
$gis_string = trim($gis_string);
|
||||
$geom_types = '(POINT|MULTIPOINT|LINESTRING|MULTILINESTRING|'
|
||||
. 'POLYGON|MULTIPOLYGON|GEOMETRYCOLLECTION)';
|
||||
@ -2293,7 +2293,7 @@ class Util
|
||||
|
||||
for ($i = 0, $length = mb_strlen($values_string); $i < $length; $i++) {
|
||||
$curr = mb_substr($values_string, $i, 1);
|
||||
$next = ($i == mb_strlen($values_string) - 1)
|
||||
$next = $i == mb_strlen($values_string) - 1
|
||||
? ''
|
||||
: mb_substr($values_string, $i + 1, 1);
|
||||
|
||||
|
||||
@ -223,7 +223,7 @@ class ZipExtension
|
||||
$timearray['seconds'] = 0;
|
||||
}
|
||||
|
||||
$time = (($timearray['year'] - 1980) << 25)
|
||||
$time = $timearray['year'] - 1980 << 25
|
||||
| ($timearray['mon'] << 21)
|
||||
| ($timearray['mday'] << 16)
|
||||
| ($timearray['hours'] << 11)
|
||||
|
||||
@ -243,7 +243,7 @@ if (isset($_REQUEST['selected_recent_table']) && Core::isValid($_REQUEST['select
|
||||
|
||||
$diMigration->setGlobal(
|
||||
'db',
|
||||
(array_key_exists('db', $recent_table) && is_string($recent_table['db'])) ? $recent_table['db'] : ''
|
||||
array_key_exists('db', $recent_table) && is_string($recent_table['db']) ? $recent_table['db'] : ''
|
||||
);
|
||||
$diMigration->setGlobal(
|
||||
'url_params',
|
||||
@ -252,7 +252,7 @@ if (isset($_REQUEST['selected_recent_table']) && Core::isValid($_REQUEST['select
|
||||
|
||||
$diMigration->setGlobal(
|
||||
'table',
|
||||
(array_key_exists('table', $recent_table) && is_string($recent_table['table'])) ? $recent_table['table'] : ''
|
||||
array_key_exists('table', $recent_table) && is_string($recent_table['table']) ? $recent_table['table'] : ''
|
||||
);
|
||||
$diMigration->setGlobal(
|
||||
'url_params',
|
||||
|
||||
@ -111,7 +111,7 @@ if ($pma_table->isEngine('ARIA')) {
|
||||
// or explicit (option found with a value of 0 or 1)
|
||||
// ($create_options['transactional'] may have been set by Table class,
|
||||
// from the $create_options)
|
||||
$create_options['transactional'] = (isset($create_options['transactional']) && $create_options['transactional'] == '0')
|
||||
$create_options['transactional'] = isset($create_options['transactional']) && $create_options['transactional'] == '0'
|
||||
? '0'
|
||||
: '1';
|
||||
$create_options['page_checksum'] = $create_options['page_checksum'] ?? '';
|
||||
@ -190,7 +190,7 @@ if (isset($_POST['submitoptions'])) {
|
||||
$new_tbl_storage_engine = mb_strtoupper($_POST['new_tbl_storage_engine']);
|
||||
|
||||
if ($pma_table->isEngine('ARIA')) {
|
||||
$create_options['transactional'] = (isset($create_options['transactional']) && $create_options['transactional'] == '0')
|
||||
$create_options['transactional'] = isset($create_options['transactional']) && $create_options['transactional'] == '0'
|
||||
? '0'
|
||||
: '1';
|
||||
$create_options['page_checksum'] = $create_options['page_checksum'] ?? '';
|
||||
@ -209,7 +209,7 @@ if (isset($_POST['submitoptions'])) {
|
||||
(empty($create_options['delay_key_write']) ? '0' : '1'),
|
||||
$row_format,
|
||||
$new_tbl_storage_engine,
|
||||
((isset($create_options['transactional']) && $create_options['transactional'] == '0') ? '0' : '1'),
|
||||
(isset($create_options['transactional']) && $create_options['transactional'] == '0' ? '0' : '1'),
|
||||
$tbl_collation
|
||||
);
|
||||
|
||||
@ -421,7 +421,7 @@ $response->addHTML(
|
||||
$create_options['pack_keys'],
|
||||
$auto_increment,
|
||||
(empty($create_options['delay_key_write']) ? '0' : '1'),
|
||||
((isset($create_options['transactional']) && $create_options['transactional'] == '0') ? '0' : '1'),
|
||||
(isset($create_options['transactional']) && $create_options['transactional'] == '0' ? '0' : '1'),
|
||||
($create_options['page_checksum'] ?? ''),
|
||||
(empty($create_options['checksum']) ? '0' : '1')
|
||||
)
|
||||
|
||||
@ -534,9 +534,8 @@ $html = $template->render('columns_definitions/column_definitions_form', [
|
||||
'max_rows' => intval($GLOBALS['cfg']['MaxRows']),
|
||||
'char_editing' => $GLOBALS['cfg']['CharEditing'] ?? null,
|
||||
'attribute_types' => $GLOBALS['dbi']->types->getAttributes(),
|
||||
'privs_available' => (($GLOBALS['col_priv'] ?? false)
|
||||
&& ($GLOBALS['is_reload_priv'] ?? false)
|
||||
),
|
||||
'privs_available' => ($GLOBALS['col_priv'] ?? false)
|
||||
&& ($GLOBALS['is_reload_priv'] ?? false),
|
||||
'max_length' => $GLOBALS['dbi']->getVersion() >= 50503 ? 1024 : 255,
|
||||
'have_partitioning' => Partition::havePartitioning(),
|
||||
'dbi' => $GLOBALS['dbi'],
|
||||
|
||||
@ -28,7 +28,7 @@ $response = Response::getInstance();
|
||||
$response->disable();
|
||||
|
||||
if (isset($_POST['eol'])) {
|
||||
$_SESSION['eol'] = ($_POST['eol'] == 'unix') ? 'unix' : 'win';
|
||||
$_SESSION['eol'] = $_POST['eol'] == 'unix' ? 'unix' : 'win';
|
||||
}
|
||||
|
||||
if (Core::ifSetOr($_POST['submit_clear'], '')) {
|
||||
|
||||
@ -930,13 +930,11 @@ class ConfigTest extends PmaTestCase
|
||||
*/
|
||||
public function testGetThemeUniqueValue()
|
||||
{
|
||||
$partial_sum = (
|
||||
$this->object->source_mtime +
|
||||
$partial_sum = $this->object->source_mtime +
|
||||
$this->object->default_source_mtime +
|
||||
$this->object->get('user_preferences_mtime') +
|
||||
$GLOBALS['PMA_Theme']->mtime_info +
|
||||
$GLOBALS['PMA_Theme']->filesize_info
|
||||
);
|
||||
$GLOBALS['PMA_Theme']->filesize_info;
|
||||
|
||||
$this->assertEquals($partial_sum, $this->object->getThemeUniqueValue());
|
||||
}
|
||||
|
||||
@ -254,7 +254,7 @@ class TrackingTest extends TestCase
|
||||
|
||||
$item = sprintf(
|
||||
__('Create version %1$s of %2$s'),
|
||||
($last_version + 1),
|
||||
$last_version + 1,
|
||||
htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table'])
|
||||
);
|
||||
$this->assertStringContainsString(
|
||||
|
||||
@ -707,7 +707,7 @@ abstract class TestBase extends TestCase
|
||||
);
|
||||
$text = $element->getText();
|
||||
|
||||
return ($text && is_string($text)) ? trim($text) : '';
|
||||
return $text && is_string($text) ? trim($text) : '';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -732,7 +732,7 @@ abstract class TestBase extends TestCase
|
||||
);
|
||||
$text = $element->getText();
|
||||
|
||||
return ($text && is_string($text)) ? trim($text) : '';
|
||||
return $text && is_string($text) ? trim($text) : '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user