diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f76e067a42..70733d6819 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -312,13 +312,7 @@ parameters: - message: '#^Parameter \#1 \$row of method PhpMyAdmin\\Bookmarks\\BookmarkRepository\:\:createFromRow\(\) expects array\, array\ given\.$#' identifier: argument.type - count: 2 - path: src/Bookmarks/BookmarkRepository.php - - - - message: '#^Parameter \#1 \$row of method PhpMyAdmin\\Bookmarks\\BookmarkRepository\:\:createFromRow\(\) expects array\, mixed given\.$#' - identifier: argument.type - count: 1 + count: 3 path: src/Bookmarks/BookmarkRepository.php - @@ -6982,7 +6976,7 @@ parameters: path: src/DatabaseInterface.php - - message: '#^Method PhpMyAdmin\\DatabaseInterface\:\:getTableIndexes\(\) should return array\ but returns array\\.$#' + message: '#^Method PhpMyAdmin\\DatabaseInterface\:\:getTableIndexes\(\) should return array\ but returns list\\>\.$#' identifier: return.type count: 1 path: src/DatabaseInterface.php @@ -10693,7 +10687,7 @@ parameters: path: src/Navigation/Nodes/ObjectFetcher.php - - message: '#^Method PhpMyAdmin\\Navigation\\Nodes\\ObjectFetcher\:\:getTablesAndViews\(\) should return array\ but returns array\\.$#' + message: '#^Method PhpMyAdmin\\Navigation\\Nodes\\ObjectFetcher\:\:getTablesAndViews\(\) should return array\ but returns list\\>\.$#' identifier: return.type count: 1 path: src/Navigation/Nodes/ObjectFetcher.php @@ -11055,12 +11049,6 @@ parameters: count: 1 path: src/Operations.php - - - message: '#^Cannot access offset ''Table'' on mixed\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 4 - path: src/Partitioning/Maintenance.php - - message: ''' #^Call to deprecated method getInstance\(\) of class PhpMyAdmin\\DatabaseInterface\: @@ -11070,24 +11058,6 @@ parameters: count: 4 path: src/Partitioning/Partition.php - - - message: '#^Cannot access offset ''Name'' on mixed\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Partitioning/Partition.php - - - - message: '#^Cannot access offset ''PARTITION_NAME'' on mixed\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: src/Partitioning/Partition.php - - - - message: '#^Cannot access offset ''SUBPARTITION_NAME'' on mixed\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Partitioning/Partition.php - - message: '#^Cannot cast mixed to int\.$#' identifier: cast.int @@ -11106,18 +11076,6 @@ parameters: count: 1 path: src/Partitioning/Partition.php - - - message: '#^Parameter \#1 \$row of class PhpMyAdmin\\Partitioning\\Partition constructor expects array\, mixed given\.$#' - identifier: argument.type - count: 1 - path: src/Partitioning/Partition.php - - - - message: '#^Parameter \#1 \$row of class PhpMyAdmin\\Partitioning\\SubPartition constructor expects array\, mixed given\.$#' - identifier: argument.type - count: 1 - path: src/Partitioning/Partition.php - - message: '#^PhpMyAdmin\\Partitioning\\Partition\:\:__construct\(\) does not call parent constructor from PhpMyAdmin\\Partitioning\\SubPartition\.$#' identifier: constructor.missingParentCall @@ -12744,18 +12702,6 @@ parameters: count: 3 path: src/Plugins/Export/ExportXml.php - - - message: '#^Cannot access offset ''DEFAULT_CHARACTER_SET_NAME'' on mixed\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Plugins/Export/ExportXml.php - - - - message: '#^Cannot access offset ''DEFAULT_COLLATION_NAME'' on mixed\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Plugins/Export/ExportXml.php - - message: '#^Cannot access offset ''columns'' on mixed\.$#' identifier: offsetAccess.nonOffsetAccessible @@ -12807,13 +12753,13 @@ parameters: - message: '#^Parameter \#1 \$string of function htmlspecialchars expects string, mixed given\.$#' identifier: argument.type - count: 3 + count: 1 path: src/Plugins/Export/ExportXml.php - message: '#^Parameter \#1 \$string of function htmlspecialchars expects string, string\|null given\.$#' identifier: argument.type - count: 2 + count: 4 path: src/Plugins/Export/ExportXml.php - @@ -15129,18 +15075,6 @@ parameters: count: 2 path: src/Replication/Replication.php - - - message: '#^Cannot access offset ''File'' on mixed\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Replication/Replication.php - - - - message: '#^Cannot access offset ''Position'' on mixed\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Replication/Replication.php - - message: '#^Loose comparison via "\!\=" is not allowed\.$#' identifier: notEqual.notAllowed @@ -15148,7 +15082,7 @@ parameters: path: src/Replication/Replication.php - - message: '#^Method PhpMyAdmin\\Replication\\Replication\:\:replicaBinLogPrimary\(\) should return array\{File\?\: string, Position\?\: string\} but returns array\{\}\|array\{File\: mixed, Position\: mixed\}\.$#' + message: '#^Method PhpMyAdmin\\Replication\\Replication\:\:replicaBinLogPrimary\(\) should return array\{File\?\: string, Position\?\: string\} but returns array\{\}\|array\{File\: string\|null, Position\: string\|null\}\.$#' identifier: return.type count: 1 path: src/Replication/Replication.php @@ -15555,18 +15489,6 @@ parameters: count: 2 path: src/Server/Privileges.php - - - message: '#^Cannot access offset ''CHARACTER_MAXIMUM_LENGTH'' on mixed\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: src/Server/Privileges.php - - - - message: '#^Cannot access offset ''COLUMN_NAME'' on mixed\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Server/Privileges.php - - message: '#^Cannot access offset ''Column_priv'' on mixed\.$#' identifier: offsetAccess.nonOffsetAccessible @@ -17085,16 +17007,10 @@ parameters: count: 2 path: src/Table/Table.php - - - message: '#^Cannot access offset ''Extra'' on mixed\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 3 - path: src/Table/Table.php - - message: '#^Cannot access offset ''Field'' on mixed\.$#' identifier: offsetAccess.nonOffsetAccessible - count: 3 + count: 2 path: src/Table/Table.php - @@ -17194,7 +17110,7 @@ parameters: path: src/Table/Table.php - - message: '#^Method PhpMyAdmin\\Table\\Table\:\:getNonGeneratedColumns\(\) should return array\ but returns list\\.$#' + message: '#^Method PhpMyAdmin\\Table\\Table\:\:getNonGeneratedColumns\(\) should return array\ but returns list\\.$#' identifier: return.type count: 1 path: src/Table/Table.php @@ -17230,7 +17146,7 @@ parameters: path: src/Table/Table.php - - message: '#^Parameter \#1 \$haystack of function str_contains expects string, mixed given\.$#' + message: '#^Parameter \#1 \$haystack of function str_contains expects string, string\|null given\.$#' identifier: argument.type count: 3 path: src/Table/Table.php @@ -17238,7 +17154,7 @@ parameters: - message: '#^Parameter \#1 \$identifier of static method PhpMyAdmin\\Util\:\:backquote\(\) expects string\|Stringable\|null, mixed given\.$#' identifier: argument.type - count: 2 + count: 1 path: src/Table/Table.php - @@ -17730,6 +17646,12 @@ parameters: count: 4 path: src/Triggers/Triggers.php + - + message: '#^PHPDoc tag @var with type array\\> is not subtype of type list\\>\.$#' + identifier: varTag.type + count: 1 + path: src/Triggers/Triggers.php + - message: '#^Parameter \#1 \$haystack of function str_contains expects string, mixed given\.$#' identifier: argument.type diff --git a/psalm-baseline.xml b/psalm-baseline.xml index bd1cd1db95..ca3b5b8bf5 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -64,13 +64,8 @@ + - - - - - - bookmarkFeature]]> @@ -6189,17 +6184,15 @@ + dbi->fetchResultSimple($query)]]> dbi->fetchSingleColumn($query)]]> dbi->fetchSingleColumn($query)]]> + - - dbi->fetchResultSimple($query)]]> - - @@ -6443,28 +6436,12 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + @@ -6473,29 +6450,16 @@ - - - - - - - - - - - - - description]]> expression]]> method]]> name]]> - - - - + + + + @@ -6503,6 +6467,7 @@ fetchValue('SELECT @@have_partitioning;')]]> + @@ -7330,20 +7295,16 @@ - - - - - - + + @@ -8842,26 +8803,20 @@ + + + - - - - - - - - - - + - + @@ -9054,10 +9009,6 @@ - - - - @@ -9073,7 +9024,6 @@ - @@ -9088,8 +9038,6 @@ - - @@ -9832,6 +9780,7 @@ + getStatusInfo('TABLE_COLLATION') ?? '']]> getStatusInfo('TABLE_COMMENT') ?? '']]> @@ -9840,11 +9789,10 @@ + - - @@ -9852,7 +9800,6 @@ uiprefs[$property->value]]]> uiprefs[$property->value]]]> - @@ -9860,9 +9807,6 @@ dbName][$this->name]]]> - - - @@ -9886,12 +9830,9 @@ - - - @@ -9904,9 +9845,7 @@ - ]]> - @@ -9920,6 +9859,8 @@ + + refDbName]]> refTableName]]> diff --git a/src/DatabaseInterface.php b/src/DatabaseInterface.php index 838d3a763d..0abf9fe274 100644 --- a/src/DatabaseInterface.php +++ b/src/DatabaseInterface.php @@ -1352,7 +1352,7 @@ class DatabaseInterface implements DbalInterface return $resultRows; } - /** @return array */ + /** @return list> */ public function fetchResultSimple( string $query, ConnectionType $connectionType = ConnectionType::User, @@ -1363,10 +1363,6 @@ class DatabaseInterface implements DbalInterface return []; } - if ($result->numFields() === 1) { - return $result->fetchAllColumn(); - } - return $result->fetchAllAssoc(); }