Skip to content

Commit

Permalink
Fix some errors detected by PHPStan
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 Jul 31, 2019
1 parent daf7666 commit c83e62c
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion db_import.php
Expand Up @@ -15,7 +15,7 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $db, $table;
global $db, $max_upload_size, $table;

require_once ROOT_PATH . 'libraries/common.inc.php';

Expand Down
2 changes: 1 addition & 1 deletion import.php
Expand Up @@ -30,7 +30,7 @@
define('PMA_ENABLE_LDI', 1);
}

global $containerBuilder, $db, $pmaThemeImage, $table;
global $cfg, $containerBuilder, $db, $import_type, $pmaThemeImage, $table;

require_once ROOT_PATH . 'libraries/common.inc.php';

Expand Down
3 changes: 0 additions & 3 deletions phpstan.neon.dist
Expand Up @@ -12,14 +12,11 @@ parameters:
- '#PHPUnit\\Framework\\MockObject#'
- '#Access to an undefined property PhpMyAdmin\\TwoFactor\:\:\$(backend|showSubmit|available|writable)#'
- '#Call to an undefined method PhpMyAdmin\\Navigation\\Nodes\\Node\:\:getHiddenCount#'
- '#Undefined variable: \$array#'
- '#Undefined variable: \$(export_type|err_url|collation_connection|filename_template|transform_key|cn|goto|token_mismatch|auth_plugin|username|hostname|display_query)#'#Others
- '#Undefined variable: \$max_upload_size#'#tbl_import.php
- '#Undefined variable: \$(repobase|fullrevision|revision|repobranchbase|branch)#'#Footer.php
- '#Variable \$_(REQUEST|GET|POST|COOKIE|SESSION) in isset\(\) always exists and is not nullable#'#Sanitize.php
- '#Variable \$msg1 might not be defined#'#Twig/I18n/NodeTrans.php
- '#Variable \$(foreign_db|foreign_table) might not be defined#'#Relation.php, do while(false) + break
- '#Variable \$(sql_query|table|db|cfg|import_type|goto) might not be defined#'# Others
- '#Variable \$(sql_query|table|db|cfg|url_query) in isset\(\) always exists and is not nullable#'#Others
- '#Variable \$(last_cumulative_type) in isset\(\) always exists and is not nullable#'#Import.php
- '#Variable \$(routine|mode|title|message|output|nbResultsetToDisplay|item) might not be defined#'# Rte
Expand Down
2 changes: 1 addition & 1 deletion server_import.php
Expand Up @@ -15,7 +15,7 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $db, $table;
global $db, $max_upload_size, $table;

require_once ROOT_PATH . 'libraries/common.inc.php';

Expand Down
2 changes: 1 addition & 1 deletion sql.php
Expand Up @@ -23,7 +23,7 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $cfg, $containerBuilder, $pmaThemeImage;
global $cfg, $containerBuilder, $db, $display_query, $pmaThemeImage, $sql_query, $table;

require_once ROOT_PATH . 'libraries/common.inc.php';

Expand Down
2 changes: 1 addition & 1 deletion tbl_export.php
Expand Up @@ -17,7 +17,7 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder, $db, $url_query;
global $containerBuilder, $db, $url_query, $table;

require_once ROOT_PATH . 'libraries/common.inc.php';

Expand Down
2 changes: 1 addition & 1 deletion tbl_import.php
Expand Up @@ -15,7 +15,7 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $db, $table, $url_query;
global $db, $max_upload_size, $table, $url_query;

require_once ROOT_PATH . 'libraries/common.inc.php';

Expand Down
2 changes: 1 addition & 1 deletion test/classes/CoreTest.php
Expand Up @@ -991,7 +991,7 @@ public function testNullFail()
*/
public function testNotSetArray()
{
/** @var $array undefined array */
$array = [];
$this->assertFalse(Core::isValid($array['x']));
}

Expand Down

0 comments on commit c83e62c

Please sign in to comment.