Skip to content

Commit

Permalink
Add coding standard rules for whitespace
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
  • Loading branch information
MauricioFauth committed Jan 20, 2020
1 parent 63dbcd0 commit 2859079
Show file tree
Hide file tree
Showing 99 changed files with 61 additions and 182 deletions.
2 changes: 2 additions & 0 deletions examples/openid.php
Expand Up @@ -34,6 +34,7 @@
];

// phpcs:disable PSR1.Files.SideEffects

/**
* Simple function to show HTML page with given content.
*
Expand Down Expand Up @@ -82,6 +83,7 @@ function Die_error($e)
Show_page($contents);
exit;
}

// phpcs:enable

/* Need to have cookie visible from parent directory */
Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/Config.php
Expand Up @@ -1484,7 +1484,7 @@ public function setCookie(

$httpCookieName = $this->getCookieName($cookie);

if (! $this->issetCookie($cookie) || $this->getCookie($cookie) !== $value) {
if (! $this->issetCookie($cookie) || $this->getCookie($cookie) !== $value) {
// set cookie with new value
/* Calculate cookie validity */
if ($validity === null) {
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Config/FormDisplay.php
Expand Up @@ -780,7 +780,6 @@ public function hasErrors()
return count($this->_errors) > 0;
}


/**
* Returns link to documentation
*
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Config/Validator.php
Expand Up @@ -364,7 +364,6 @@ public static function validatePMAStorage($path, array $values)
return $result;
}


/**
* Validates regular expression
*
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Controllers/HomeController.php
Expand Up @@ -58,7 +58,6 @@ public function __construct($response, $dbi, Template $template, $config, ThemeM
$this->themeManager = $themeManager;
}


/**
* @param array $params Request parameters
*
Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/Controllers/Table/RelationController.php
Expand Up @@ -368,7 +368,7 @@ public function getDropdownValueForDatabase(string $storageEngine): void

while ($row = $this->dbi->fetchArray($tables_rs)) {
if (isset($row['Engine'])
&& mb_strtoupper($row['Engine']) == $storageEngine
&& mb_strtoupper($row['Engine']) == $storageEngine
) {
$tables[] = htmlspecialchars($row['Name']);
}
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Core.php
Expand Up @@ -556,7 +556,6 @@ public static function noCacheHeader(): void
header('Last-Modified: ' . gmdate(DATE_RFC1123));
}


/**
* Sends header indicating file download.
*
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Database/Designer.php
Expand Up @@ -303,7 +303,6 @@ public function getDatabaseTables(
]);
}


/**
* Returns HTML for Designer page
*
Expand Down
1 change: 1 addition & 0 deletions libraries/classes/Database/Qbe.php
Expand Up @@ -384,6 +384,7 @@ private function _setCriteriaTablesAndColumns()
// sets the largest width found
$this->_realwidth = $this->_form_column_width . 'ex';
}

/**
* Provides select options list containing column names
*
Expand Down
2 changes: 0 additions & 2 deletions libraries/classes/DatabaseInterface.php
Expand Up @@ -392,7 +392,6 @@ public function getTables(string $database, $link = DatabaseInterface::CONNECT_U
return $tables;
}


/**
* returns
*
Expand Down Expand Up @@ -854,7 +853,6 @@ public function getVirtualTables(string $db): array
return $views;
}


/**
* returns array with databases containing extended infos about them
*
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Display/Export.php
Expand Up @@ -330,7 +330,6 @@ private function getHtmlForOptionsOutputSaveDir()
]);
}


/**
* Prints Html For Export Options
*
Expand Down
22 changes: 2 additions & 20 deletions libraries/classes/Display/Results.php
Expand Up @@ -440,7 +440,6 @@ public function setProperties(
$editable,
$is_browse_dist
) {

$this->__set('unlim_num_rows', $unlim_num_rows);
$this->__set('fields_meta', $fields_meta);
$this->__set('is_count', $is_count);
Expand Down Expand Up @@ -1389,7 +1388,6 @@ private function _getFieldVisibilityParams(
array &$displayParts,
$full_or_partial_text_link
) {

$button_html = '';
$display_params = $this->__get('display_params');

Expand Down Expand Up @@ -1586,7 +1584,6 @@ private function _getOptionsBlock()
*/
private function _getFullOrPartialTextButtonOrLink()
{

$url_params_full_text = [
'db' => $this->__get('db'),
'table' => $this->__get('table'),
Expand Down Expand Up @@ -1667,7 +1664,6 @@ private function _getOrderLinkAndSortedHeaderHtml(
$col_visib,
$col_visib_j
) {

$sorted_header_html = '';

// Checks if the table name is required; it's the case
Expand Down Expand Up @@ -1832,15 +1828,15 @@ private function _getSingleAndMultiSortUrls(
$query_head = $is_first_clause ? "\nORDER BY " : '';
// Again a check to see if the given column is a aggregate column
if (mb_strpos($name_to_use_in_sort, '(') !== false) {
$sort_order .= $query_head . $name_to_use_in_sort . ' ' ;
$sort_order .= $query_head . $name_to_use_in_sort . ' ';
} else {
if (strlen($sort_tbl_new) > 0) {
$sort_tbl_new .= '.';
}
$sort_order .= $query_head . $sort_tbl_new
. Util::backquote(
$name_to_use_in_sort
) . ' ' ;
) . ' ';
}

// For a special case where the code generates two dots between
Expand Down Expand Up @@ -1918,7 +1914,6 @@ private function _isInSorted(
$sort_tbl,
$name_to_use_in_sort
) {

$index_in_expression = 0;

foreach ($sort_expression_nodirection as $index => $clause) {
Expand Down Expand Up @@ -2115,7 +2110,6 @@ private function _getDraggableClassForSortableColumns(
$order_link,
$comments
) {

$draggable_html = '<th';
$th_class = [];
$th_class[] = 'draggable';
Expand Down Expand Up @@ -2164,7 +2158,6 @@ private function _getDraggableClassForNonSortableColumns(
$fields_meta,
$comments
) {

$draggable_html = '<th';
$th_class = [];
$th_class[] = 'draggable';
Expand Down Expand Up @@ -2207,7 +2200,6 @@ private function _getColumnAtRightSide(
$full_or_partial_text_link,
$colspan
) {

$right_column_html = '';
$display_params = $this->__get('display_params');

Expand Down Expand Up @@ -3084,7 +3076,6 @@ private function _getSpecialLinkUrl(
*/
private function _getRowInfoForSpecialLinks(array $row, $col_order)
{

$row_info = [];
$fields_meta = $this->__get('fields_meta');

Expand Down Expand Up @@ -3231,7 +3222,6 @@ private function _getModifiedLinks(
$clause_is_unique,
$url_sql_query
) {

$_url_params = [
'db' => $this->__get('db'),
'table' => $this->__get('table'),
Expand Down Expand Up @@ -3298,7 +3288,6 @@ private function _getDeleteAndKillLinks(
$del_lnk,
array $row
) {

$goto = $this->__get('goto');

if ($del_lnk == self::DELETE_ROW) { // delete row case
Expand Down Expand Up @@ -3380,7 +3369,6 @@ private function _getDeleteAndKillLinks(
*/
private function _getActionLinkContent($icon, $display_text)
{

$linkContent = '';

if (isset($GLOBALS['cfg']['RowActionType'])
Expand Down Expand Up @@ -3446,7 +3434,6 @@ private function _getPlacedLinks(
$del_str,
?string $js_conf
) {

if (! isset($js_conf)) {
$js_conf = '';
}
Expand Down Expand Up @@ -3560,7 +3547,6 @@ private function _getDataCellForNumericColumns(
$default_function,
array $transform_options
) {

if (! isset($column) || $column === null) {
$cell = $this->_buildNullDisplay(
'right ' . $class,
Expand Down Expand Up @@ -3948,7 +3934,6 @@ private function _getDataCellForNonNumericColumns(
*/
public function setConfigParamsForDisplayTable()
{

$sql_md5 = md5($this->__get('sql_query'));
$query = [];
if (isset($_SESSION['tmpval']['query'][$sql_md5])) {
Expand Down Expand Up @@ -4338,7 +4323,6 @@ public function getTable(
*/
private function _getOffsets()
{

if ($_SESSION['tmpval']['max_rows'] == self::ALL_ROWS) {
$pos_next = 0;
$pos_prev = 0;
Expand Down Expand Up @@ -4511,7 +4495,6 @@ private function _setMessageInformation(
$pre_count,
$after_count
) {

$unlim_num_rows = $this->__get('unlim_num_rows'); // To use in isset()

if (! empty($analyzed_sql_results['statement']->limit)) {
Expand Down Expand Up @@ -5516,7 +5499,6 @@ private function _getCopyLink(
*/
private function _getDeleteLink($del_url, $del_str, $js_conf, $class)
{

$ret = '';
if (empty($del_url)) {
return $ret;
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Encoding.php
Expand Up @@ -290,7 +290,6 @@ public static function kanjiStrConv(string $str, string $enc, string $kana): str
return $dist;
}


/**
* Kanji file encoding convert
*
Expand Down
2 changes: 2 additions & 0 deletions libraries/classes/Engines/Pbxt.php
Expand Up @@ -157,6 +157,7 @@ public function resolveTypeSize($formatted_size)
}

//--------------------

/**
* Get information about pages
*
Expand All @@ -171,6 +172,7 @@ public function getInfoPages()
}

//--------------------

/**
* Get content of documentation page
*
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Error.php
Expand Up @@ -216,7 +216,6 @@ public function setFile(string $file): void
$this->file = self::relPath($file);
}


/**
* returns unique PhpMyAdmin\Error::$hash, if not exists it will be created
*
Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/ErrorHandler.php
Expand Up @@ -357,7 +357,7 @@ public function getDispErrors(): string
// if preference is not 'never' and
// there are 'actual' errors to be reported
if ($GLOBALS['cfg']['SendErrorReports'] != 'never'
&& $this->countErrors() != $this->countUserErrors()
&& $this->countErrors() != $this->countUserErrors()
) {
// add report button.
$retval .= '<form method="post" action="' . Url::getFromRoute('/error-report')
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/File.php
Expand Up @@ -623,7 +623,6 @@ public function setHandle($handle): void
$this->_handle = $handle;
}


/**
* Sets error message for unsupported compression.
*
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Gis/GisPolygon.php
Expand Up @@ -405,7 +405,6 @@ public function generateWkt(array $gis_data, $index, $empty = '')
*/
public static function area(array $ring)
{

$no_of_points = count($ring);

// If the last point is same as the first point ignore it
Expand Down
Expand Up @@ -18,7 +18,6 @@
*/
class BrowseUploadFileBlock implements FieldGenerator
{

/**
* Prepare the form used to browse anywhere on the local server for a file to
* import
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Html/Forms/Fields/DropDown.php
Expand Up @@ -21,7 +21,6 @@
*/
class DropDown implements FieldGenerator
{

/**
* Generates and returns an HTML dropdown
*
Expand Down
Expand Up @@ -20,7 +20,6 @@
*/
class DropDownUploadFileBlock implements FieldGenerator
{

/**
* Prepare the form used to select a file to import from the server upload
* directory
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Html/Forms/Fields/FKCheckbox.php
Expand Up @@ -22,7 +22,6 @@
*/
class FKCheckbox implements FieldGenerator
{

/**
* Get HTML for Foreign key check checkbox
*
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Html/Forms/Fields/MaxFileSize.php
Expand Up @@ -15,7 +15,6 @@
*/
class MaxFileSize implements FieldGenerator
{

/**
* Generates a hidden field which should indicate to the browser
* the maximum size for upload
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Html/Forms/Fields/RadioList.php
Expand Up @@ -21,7 +21,6 @@
*/
class RadioList implements FieldGenerator
{

/**
* Generates a set of radio HTML fields
*
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Html/Generator.php
Expand Up @@ -1411,7 +1411,6 @@ public static function getListNavigator(
$name = 'pos',
$classes = []
): string {

// This is often coming from $cfg['MaxTableList'] and
// people sometimes set it to empty string
$max_count = intval($max_count);
Expand Down
2 changes: 0 additions & 2 deletions libraries/classes/Import.php
Expand Up @@ -349,7 +349,6 @@ public function lookForUse(?string $buffer, ?string $db, ?bool $reload): array
];
}


/**
* Returns next part of imported file/buffer
*
Expand Down Expand Up @@ -1340,7 +1339,6 @@ public function buildSql(
$import_notice = $message;
}


/**
* Stops the import on (mostly upload/file related) error
*
Expand Down

0 comments on commit 2859079

Please sign in to comment.