Fix some errors detected by Psalm

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2023-01-05 16:27:20 -03:00
parent b7466dad07
commit dfd5f13078
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8
5 changed files with 8 additions and 13 deletions

View File

@ -301,11 +301,10 @@ final class ImportController extends AbstractController
}
$timestamp = time();
if (isset($_POST['allow_interrupt'])) {
$maximum_time = ini_get('max_execution_time');
$maximum_time -= 1;// Give 1 second for phpMyAdmin to exit nicely
} else {
$maximum_time = 0;
$maximum_time = 0;
$maxExecutionTime = (int) ini_get('max_execution_time');
if (isset($_POST['allow_interrupt']) && $maxExecutionTime >= 1) {
$maximum_time = $maxExecutionTime - 1; // Give 1 second for phpMyAdmin to exit nicely
}
// set default values

View File

@ -398,6 +398,7 @@ class Header
$console = $this->console->getDisplay();
$messages = $this->getMessage();
$isLoggedIn = isset($GLOBALS['dbi']) && $GLOBALS['dbi']->isConnected();
return $this->template->render('header', [
'lang' => $GLOBALS['lang'],
@ -416,7 +417,7 @@ class Header
'show_hint' => $GLOBALS['cfg']['ShowHint'],
'is_warnings_enabled' => $this->warningsEnabled,
'is_menu_enabled' => $this->menuEnabled,
'is_logged_in' => isset($dbi) ? $dbi->isConnected() : false,
'is_logged_in' => $isLoggedIn,
'menu' => $menu ?? '',
'console' => $console,
'messages' => $messages,

View File

@ -8010,11 +8010,6 @@ parameters:
count: 1
path: libraries/classes/Sql.php
-
message: "#^Method PhpMyAdmin\\\\Sql\\:\\:getDetailedProfilingStats\\(\\) should return array\\<string, array\\|int\\> but returns array\\<string, array\\<int\\|string, mixed\\>\\|float\\|int\\>\\.$#"
count: 1
path: libraries/classes/Sql.php
-
message: "#^Method PhpMyAdmin\\\\Sql\\:\\:getHtmlForPreviousUpdateQuery\\(\\) has parameter \\$sqlData with no value type specified in iterable type array\\.$#"
count: 1

View File

@ -7907,7 +7907,7 @@
<code>getExtension</code>
<code>getProperties</code>
</MixedMethodCall>
<MixedOperand occurrences="24">
<MixedOperand occurrences="23">
<code>$charset</code>
<code>$charset</code>
<code>$collation</code>
@ -7916,7 +7916,6 @@
<code>$display_query</code>
<code>$executed_queries</code>
<code>$importPlugin-&gt;getProperties()-&gt;getExtension()</code>
<code>$maximum_time</code>
<code>$msg</code>
<code>$read_multiply</code>
<code>$read_multiply</code>

View File

@ -399,6 +399,7 @@
xml_export_triggers: bool,
xml_export_views: bool
}"/>
<var name="maximum_time" type="0|positive-int"/>
<var name="PMA_PHP_SELF" type="string"/>
</globals>
</psalm>