Merge pull request #14844 from Tithugues/feature/remove-useless-variables-before-return

Remove useless variables before return
This commit is contained in:
Maurício Meneghini Fauth 2019-01-12 13:09:27 -03:00 committed by GitHub
commit 452ec0ded2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 15 additions and 38 deletions

View File

@ -32,10 +32,8 @@ function get_login_credentials($user)
}
/* Here we would retrieve the credentials */
$credentials = [
return [
'root',
'',
];
return $credentials;
}

View File

@ -319,9 +319,7 @@ class GisVisualization
*/
public function asSVG()
{
$output = $this->_svg();
return $output;
return $this->_svg();
}
/**

View File

@ -876,8 +876,7 @@ class AuthenticationCookie extends AuthenticationPlugin
if ($this->_use_openssl) {
return openssl_cipher_iv_length('AES-128-CBC');
}
$cipher = new Crypt\AES(Crypt\Base::MODE_CBC);
return $cipher->block_size;
return (new Crypt\AES(Crypt\Base::MODE_CBC))->block_size;
}
/**

View File

@ -55,8 +55,6 @@ class UploadNoplugin implements UploadInterface
'plugin' => UploadNoplugin::getIdKey(),
];
}
$ret = $_SESSION[$SESSION_KEY][$id];
return $ret;
return $_SESSION[$SESSION_KEY][$id];
}
}

View File

@ -45,9 +45,7 @@ abstract class SQLTransformationsPlugin extends TransformationsPlugin
public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
{
// see PMA_highlightSQL()
$result = Util::formatSql($buffer);
return $result;
return Util::formatSql($buffer);
}

View File

@ -5341,9 +5341,7 @@ class Privileges
"SELECT PASSWORD('" . $password . "') AS `password`;"
);
$hashedPassword = $result['password'];
return $hashedPassword;
return $result['password'];
}
/**

View File

@ -553,9 +553,7 @@ EOT;
DatabaseInterface::QUERY_STORE
);
$values = Util::parseEnumSetValues($field_info_result[0]['Type']);
return $values;
return Util::parseEnumSetValues($field_info_result[0]['Type']);
}
/**

View File

@ -2650,8 +2650,7 @@ class Table
$sql .= " AND `COLUMN_NAME` = '" . $this->_dbi->escapeString($column)
. "'";
}
$columns = $this->_dbi->fetchResult($sql, 'Field', 'Expression');
return $columns;
return $this->_dbi->fetchResult($sql, 'Field', 'Expression');
}
$createTable = $this->showCreate();

View File

@ -320,9 +320,7 @@ class Tracker
$sql_query .= " AND `version` = '"
. $GLOBALS['dbi']->escapeString($version) . "'";
}
$result = $relation->queryAsControlUser($sql_query);
return $result;
return $relation->queryAsControlUser($sql_query);
}
/**
@ -387,9 +385,7 @@ class Tracker
'" . $GLOBALS['dbi']->escapeString($tracking_set)
. "' )";
$result = $relation->queryAsControlUser($sql_query);
return $result;
return $relation->queryAsControlUser($sql_query);
}
@ -420,9 +416,7 @@ class Tracker
" AND `table_name` = '" . $GLOBALS['dbi']->escapeString($tablename) . "' " .
" AND `version` = '" . $GLOBALS['dbi']->escapeString((string) $version) . "' ";
$result = $relation->queryAsControlUser($sql_query);
return $result;
return $relation->queryAsControlUser($sql_query);
}
/**

View File

@ -1280,8 +1280,8 @@ class Tracking
public function getUntrackedTables($db)
{
$table_list = Util::getTableList($db);
$untracked_tables = $this->extractTableNames($table_list, $db); //Use helper function to get table list recursively.
return $untracked_tables;
//Use helper function to get table list recursively.
return $this->extractTableNames($table_list, $db);
}
/**

View File

@ -157,9 +157,7 @@ class Util
// generate the IMG tag
$template = '<img src="themes/dot.gif" title="%s" alt="%s"%s>';
$retval = sprintf($template, $title, $alt, $attr_str);
return $retval;
return sprintf($template, $title, $alt, $attr_str);
}
/**
@ -3524,8 +3522,7 @@ class Util
*/
public static function unsupportedDatatypes()
{
$no_support_types = [];
return $no_support_types;
return [];
}
/**