Fix some issues
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
parent
f985fab99a
commit
4acd79bd83
@ -2259,6 +2259,18 @@ parameters:
|
||||
count: 1
|
||||
path: src/Controllers/Server/DatabasesController.php
|
||||
|
||||
-
|
||||
message: '#^Offset ''Do_DB'' might not exist on array\{status\: true, Do_DB\?\: array\<string\>, Ignore_DB\?\: array\<string\>\}\.$#'
|
||||
identifier: offsetAccess.notFound
|
||||
count: 2
|
||||
path: src/Controllers/Server/DatabasesController.php
|
||||
|
||||
-
|
||||
message: '#^Offset ''Ignore_DB'' might not exist on array\{status\: true, Do_DB\?\: array\<string\>, Ignore_DB\?\: array\<string\>\}\.$#'
|
||||
identifier: offsetAccess.notFound
|
||||
count: 1
|
||||
path: src/Controllers/Server/DatabasesController.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#1 \$params of static method PhpMyAdmin\\Url\:\:getCommonRaw\(\) expects array\<int\|string, bool\|int\|string\>, array\<string, mixed\> given\.$#'
|
||||
identifier: argument.type
|
||||
@ -2274,13 +2286,13 @@ parameters:
|
||||
-
|
||||
message: '#^Parameter \#1 \$value of function count expects array\|Countable, mixed given\.$#'
|
||||
identifier: argument.type
|
||||
count: 2
|
||||
count: 1
|
||||
path: src/Controllers/Server/DatabasesController.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#2 \$haystack of function array_search expects array, mixed given\.$#'
|
||||
identifier: argument.type
|
||||
count: 4
|
||||
count: 2
|
||||
path: src/Controllers/Server/DatabasesController.php
|
||||
|
||||
-
|
||||
@ -2331,12 +2343,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Controllers/Server/PrivilegesController.php
|
||||
|
||||
-
|
||||
message: '#^Only booleans are allowed in an if condition, mixed given\.$#'
|
||||
identifier: if.condNotBoolean
|
||||
count: 1
|
||||
path: src/Controllers/Server/ReplicationController.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#2 \$serverReplicaStatus of method PhpMyAdmin\\Replication\\ReplicationGui\:\:getHtmlForReplicaConfiguration\(\) expects bool, mixed given\.$#'
|
||||
identifier: argument.type
|
||||
@ -2436,7 +2442,7 @@ parameters:
|
||||
-
|
||||
message: '#^Only booleans are allowed in an if condition, mixed given\.$#'
|
||||
identifier: if.condNotBoolean
|
||||
count: 2
|
||||
count: 1
|
||||
path: src/Controllers/Server/Status/StatusController.php
|
||||
|
||||
-
|
||||
@ -9366,6 +9372,12 @@ parameters:
|
||||
count: 1
|
||||
path: src/Plugins/Import/ImportSql.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#1 \$sqlCompatibility of method PhpMyAdmin\\Plugins\\Import\\ImportSql\:\:setSQLMode\(\) expects string\|null, mixed given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: src/Plugins/Import/ImportSql.php
|
||||
|
||||
-
|
||||
message: '#^Argument of an invalid type SimpleXMLElement\|null supplied for foreach, only iterables are supported\.$#'
|
||||
identifier: foreach.nonIterable
|
||||
@ -10992,12 +11004,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Server/Privileges.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset 0 on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 2
|
||||
path: src/Server/Privileges.php
|
||||
|
||||
-
|
||||
message: '#^Cannot cast array\<string\>\|string\|null to string\.$#'
|
||||
identifier: cast.string
|
||||
@ -11136,18 +11142,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Server/Privileges.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#1 \$query of method PhpMyAdmin\\Dbal\\DatabaseInterface\:\:query\(\) expects string, mixed given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: src/Server/Privileges.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#1 \$query of method PhpMyAdmin\\Dbal\\DatabaseInterface\:\:tryQuery\(\) expects string, mixed given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: src/Server/Privileges.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#1 \$row of method PhpMyAdmin\\Server\\Privileges\:\:extractPrivInfo\(\) expects array\<mixed\>\|null, mixed given\.$#'
|
||||
identifier: argument.type
|
||||
@ -11334,7 +11328,7 @@ parameters:
|
||||
-
|
||||
message: '#^Only booleans are allowed in an if condition, mixed given\.$#'
|
||||
identifier: if.condNotBoolean
|
||||
count: 2
|
||||
count: 1
|
||||
path: src/Server/Status/Data.php
|
||||
|
||||
-
|
||||
@ -13440,18 +13434,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/ZipExtension.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#1 \$keys of function array_combine expects array\<int\|string\>, array\<mixed, mixed\> given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: src/ZipExtension.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#3 \$subject of function str_replace expects array\<string\>\|string, \(int\|string\) given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: src/ZipExtension.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''Console'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
|
||||
@ -1589,9 +1589,6 @@
|
||||
<MixedArgument>
|
||||
<code><![CDATA[$database['DEFAULT_COLLATION_NAME']]]></code>
|
||||
<code><![CDATA[$database['SCHEMA_NAME']]]></code>
|
||||
<code><![CDATA[$primaryInfo['Do_DB']]]></code>
|
||||
<code><![CDATA[$primaryInfo['Do_DB']]]></code>
|
||||
<code><![CDATA[$primaryInfo['Ignore_DB']]]></code>
|
||||
<code><![CDATA[$replicaInfo['Do_DB']]]></code>
|
||||
<code><![CDATA[$replicaInfo['Do_DB']]]></code>
|
||||
<code><![CDATA[$replicaInfo['Ignore_DB']]]></code>
|
||||
@ -1622,9 +1619,11 @@
|
||||
<code><![CDATA[$database]]></code>
|
||||
<code><![CDATA[$key]]></code>
|
||||
<code><![CDATA[$key]]></code>
|
||||
<code><![CDATA[$key]]></code>
|
||||
<code><![CDATA[$key]]></code>
|
||||
</MixedAssignment>
|
||||
<PossiblyUndefinedArrayOffset>
|
||||
<code><![CDATA[$primaryInfo['Do_DB']]]></code>
|
||||
<code><![CDATA[$primaryInfo['Ignore_DB']]]></code>
|
||||
</PossiblyUndefinedArrayOffset>
|
||||
<PossiblyUnusedReturnValue>
|
||||
<code><![CDATA[Response]]></code>
|
||||
</PossiblyUnusedReturnValue>
|
||||
@ -1675,9 +1674,6 @@
|
||||
<code><![CDATA[$urlDbname ?? '']]></code>
|
||||
<code><![CDATA[$urlDbname ?? '']]></code>
|
||||
</MixedArgument>
|
||||
<MixedArgumentTypeCoercion>
|
||||
<code><![CDATA[$queries]]></code>
|
||||
</MixedArgumentTypeCoercion>
|
||||
<RiskyTruthyFalsyComparison>
|
||||
<code><![CDATA[empty($_REQUEST['ajax_page_request'])]]></code>
|
||||
</RiskyTruthyFalsyComparison>
|
||||
@ -6284,14 +6280,9 @@
|
||||
</PossiblyUnusedReturnValue>
|
||||
</file>
|
||||
<file src="src/Plugins/Import/ImportSql.php">
|
||||
<MixedArgumentTypeCoercion>
|
||||
<code><![CDATA[$sqlModes]]></code>
|
||||
</MixedArgumentTypeCoercion>
|
||||
<MixedAssignment>
|
||||
<code><![CDATA[$sqlModes[]]]></code>
|
||||
</MixedAssignment>
|
||||
<PossiblyInvalidArgument>
|
||||
<code><![CDATA[$_POST['sql_delimiter']]]></code>
|
||||
<code><![CDATA[$_REQUEST['sql_compatibility'] ?? null]]></code>
|
||||
</PossiblyInvalidArgument>
|
||||
<PossiblyInvalidCast>
|
||||
<code><![CDATA[$_POST['sql_delimiter']]]></code>
|
||||
@ -7272,12 +7263,7 @@
|
||||
<code><![CDATA[$row['Proc_priv']]]></code>
|
||||
<code><![CDATA[$row['Table_priv']]]></code>
|
||||
<code><![CDATA[$row['Table_priv']]]></code>
|
||||
<code><![CDATA[$sqlQuery]]></code>
|
||||
<code><![CDATA[$sqlQuery]]></code>
|
||||
</MixedArgument>
|
||||
<MixedArgumentTypeCoercion>
|
||||
<code><![CDATA[$queries]]></code>
|
||||
</MixedArgumentTypeCoercion>
|
||||
<MixedArrayAccess>
|
||||
<code><![CDATA[$groupAssignment[$host['User']]]]></code>
|
||||
<code><![CDATA[$row['Db']]]></code>
|
||||
@ -7288,8 +7274,6 @@
|
||||
<code><![CDATA[$row['Routine_name']]]></code>
|
||||
<code><![CDATA[$row['Table_name']]]></code>
|
||||
<code><![CDATA[$row['Table_priv']]]></code>
|
||||
<code><![CDATA[$sqlQuery[0]]]></code>
|
||||
<code><![CDATA[$sqlQuery[0]]]></code>
|
||||
</MixedArrayAccess>
|
||||
<MixedAssignment>
|
||||
<code><![CDATA[$extraData['db_wildcard_privs']]]></code>
|
||||
@ -7302,10 +7286,7 @@
|
||||
<code><![CDATA[$paramDbName]]></code>
|
||||
<code><![CDATA[$paramRoutineName]]></code>
|
||||
<code><![CDATA[$paramTableName]]></code>
|
||||
<code><![CDATA[$queries[$tmpCount]]]></code>
|
||||
<code><![CDATA[$row]]></code>
|
||||
<code><![CDATA[$sqlQuery]]></code>
|
||||
<code><![CDATA[$sqlQuery]]></code>
|
||||
</MixedAssignment>
|
||||
<MixedOperand>
|
||||
<code><![CDATA[$origValue]]></code>
|
||||
@ -8605,18 +8586,6 @@
|
||||
<code><![CDATA[$regex]]></code>
|
||||
<code><![CDATA[$specificEntry]]></code>
|
||||
</ArgumentTypeCoercion>
|
||||
<MixedArgumentTypeCoercion>
|
||||
<code><![CDATA[$name]]></code>
|
||||
<code><![CDATA[$table]]></code>
|
||||
</MixedArgumentTypeCoercion>
|
||||
<PossiblyInvalidArgument>
|
||||
<code><![CDATA[$tempName]]></code>
|
||||
<code><![CDATA[$tempName]]></code>
|
||||
</PossiblyInvalidArgument>
|
||||
<PossiblyInvalidOperand>
|
||||
<code><![CDATA[$tempName]]></code>
|
||||
<code><![CDATA[$tempName]]></code>
|
||||
</PossiblyInvalidOperand>
|
||||
</file>
|
||||
<file src="tests/end-to-end/TestBase.php">
|
||||
<DeprecatedConstant>
|
||||
|
||||
@ -174,8 +174,8 @@ final class DatabasesController implements InvocableController
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed[] $primaryInfo
|
||||
* @param mixed[] $replicaInfo
|
||||
* @param array{status: bool, Do_DB?: string[], Ignore_DB?: string[]} $primaryInfo
|
||||
* @param mixed[] $replicaInfo
|
||||
*
|
||||
* @return array{databases:mixed[], total_statistics:mixed[]}
|
||||
*/
|
||||
|
||||
@ -95,7 +95,7 @@ class ImportSql extends ImportPlugin
|
||||
public function doImport(File|null $importHandle = null): array
|
||||
{
|
||||
// Handle compatibility options.
|
||||
$this->setSQLMode($_REQUEST);
|
||||
$this->setSQLMode($_REQUEST['sql_compatibility'] ?? null, isset($_REQUEST['sql_no_auto_value_on_zero']));
|
||||
|
||||
$bq = new BufferedQuery();
|
||||
if (isset($_POST['sql_delimiter'])) {
|
||||
@ -164,19 +164,14 @@ class ImportSql extends ImportPlugin
|
||||
return $sqlStatements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle compatibility options
|
||||
*
|
||||
* @param mixed[] $request Request array
|
||||
*/
|
||||
private function setSQLMode(array $request): void
|
||||
private function setSQLMode(string|null $sqlCompatibility, bool $sqlNoAutoValueOnZero): void
|
||||
{
|
||||
$sqlModes = [];
|
||||
if (isset($request['sql_compatibility']) && $request['sql_compatibility'] !== 'NONE') {
|
||||
$sqlModes[] = $request['sql_compatibility'];
|
||||
if ($sqlCompatibility !== null && $sqlCompatibility !== 'NONE') {
|
||||
$sqlModes[] = $sqlCompatibility;
|
||||
}
|
||||
|
||||
if (isset($request['sql_no_auto_value_on_zero'])) {
|
||||
if ($sqlNoAutoValueOnZero) {
|
||||
$sqlModes[] = 'NO_AUTO_VALUE_ON_ZERO';
|
||||
}
|
||||
|
||||
|
||||
@ -79,8 +79,8 @@ final class ReplicationInfo
|
||||
/** @var mixed[] */
|
||||
private array $multiPrimaryStatus = [];
|
||||
|
||||
/** @var mixed[] */
|
||||
private array $primaryInfo = [];
|
||||
/** @var array{status: bool, Do_DB?: string[], Ignore_DB?: string[]} */
|
||||
private array $primaryInfo = ['status' => false];
|
||||
|
||||
/** @var mixed[] */
|
||||
private array $replicaInfo = [];
|
||||
@ -177,7 +177,7 @@ final class ReplicationInfo
|
||||
$this->primaryInfo['Ignore_DB'] = $this->fill($this->primaryStatus, 'Binlog_Ignore_DB');
|
||||
}
|
||||
|
||||
/** @return mixed[] */
|
||||
/** @return array{status: bool, Do_DB?: string[], Ignore_DB?: string[]} */
|
||||
public function getPrimaryInfo(): array
|
||||
{
|
||||
return $this->primaryInfo;
|
||||
|
||||
@ -1869,7 +1869,7 @@ class Privileges
|
||||
/**
|
||||
* Delete user and get message and sql query for delete user in privileges
|
||||
*
|
||||
* @param mixed[] $queries queries
|
||||
* @param string[] $queries queries
|
||||
*
|
||||
* @return array{string, Message} Message
|
||||
*/
|
||||
@ -2106,9 +2106,9 @@ class Privileges
|
||||
/**
|
||||
* Update Data for information: Deletes users
|
||||
*
|
||||
* @param mixed[] $queries queries array
|
||||
* @param string[] $queries queries array
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return string[]
|
||||
*/
|
||||
public function getDataForDeleteUsers(array $queries, bool $isChangeCopyUser): array
|
||||
{
|
||||
@ -2173,10 +2173,10 @@ class Privileges
|
||||
/**
|
||||
* update Data For Queries from queries_for_display
|
||||
*
|
||||
* @param mixed[] $queries queries array
|
||||
* @param mixed[]|null $queriesForDisplay queries array for display
|
||||
* @param string[] $queries queries array
|
||||
* @param string[]|null $queriesForDisplay queries array for display
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return string[]
|
||||
*/
|
||||
public function getDataForQueries(array $queries, array|null $queriesForDisplay): array
|
||||
{
|
||||
@ -2626,12 +2626,12 @@ class Privileges
|
||||
/**
|
||||
* Get queries for Table privileges to change or copy user
|
||||
*
|
||||
* @param string $userHostCondition user host condition to select relevant table privileges
|
||||
* @param mixed[] $queries queries array
|
||||
* @param string $username username
|
||||
* @param string $hostname host name
|
||||
* @param string $userHostCondition user host condition to select relevant table privileges
|
||||
* @param string[] $queries queries array
|
||||
* @param string $username username
|
||||
* @param string $hostname host name
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return string[]
|
||||
*/
|
||||
public function getTablePrivsQueriesForChangeOrCopyUser(
|
||||
string $userHostCondition,
|
||||
@ -2708,11 +2708,11 @@ class Privileges
|
||||
/**
|
||||
* Get queries for database specific privileges for change or copy user
|
||||
*
|
||||
* @param mixed[] $queries queries array with string
|
||||
* @param string $username username
|
||||
* @param string $hostname host name
|
||||
* @param string[] $queries queries array with string
|
||||
* @param string $username username
|
||||
* @param string $hostname host name
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return string[]
|
||||
*/
|
||||
public function getDbSpecificPrivsQueriesForChangeOrCopyUser(
|
||||
array $queries,
|
||||
|
||||
@ -195,7 +195,7 @@ class ZipExtension
|
||||
* same amount of elements.
|
||||
*
|
||||
* @param string[]|string $data contents of the file/files
|
||||
* @param mixed[]|string $name name of the file/files in the archive
|
||||
* @param string[]|string $name name of the file/files in the archive
|
||||
*
|
||||
* @return string|false the ZIP file contents, or false if there was an error.
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user