diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 28dc3da2e5..8512ace12a 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -4660,7 +4660,7 @@ parameters: path: src/Controllers/Table/RelationController.php - - message: '#^Parameter \#1 \$destinationForeignDb of method PhpMyAdmin\\Table\\Table\:\:updateForeignKeys\(\) expects array\, mixed given\.$#' + message: '#^Parameter \#1 \$destinationForeignDb of method PhpMyAdmin\\Table\\Table\:\:updateForeignKeys\(\) expects array\, mixed given\.$#' identifier: argument.type count: 1 path: src/Controllers/Table/RelationController.php @@ -4678,7 +4678,7 @@ parameters: path: src/Controllers/Table/RelationController.php - - message: '#^Parameter \#1 \$multiEditColumnsName of method PhpMyAdmin\\Table\\Table\:\:updateInternalRelations\(\) expects array\, mixed given\.$#' + message: '#^Parameter \#1 \$multiEditColumnsName of method PhpMyAdmin\\Table\\Table\:\:updateInternalRelations\(\) expects array\, mixed given\.$#' identifier: argument.type count: 1 path: src/Controllers/Table/RelationController.php @@ -4690,13 +4690,13 @@ parameters: path: src/Controllers/Table/RelationController.php - - message: '#^Parameter \#2 \$destinationDb of method PhpMyAdmin\\Table\\Table\:\:updateInternalRelations\(\) expects array\, mixed given\.$#' + message: '#^Parameter \#2 \$destinationDb of method PhpMyAdmin\\Table\\Table\:\:updateInternalRelations\(\) expects array\, mixed given\.$#' identifier: argument.type count: 1 path: src/Controllers/Table/RelationController.php - - message: '#^Parameter \#2 \$multiEditColumnsName of method PhpMyAdmin\\Table\\Table\:\:updateForeignKeys\(\) expects array\, mixed given\.$#' + message: '#^Parameter \#2 \$multiEditColumnsName of method PhpMyAdmin\\Table\\Table\:\:updateForeignKeys\(\) expects array\\>, mixed given\.$#' identifier: argument.type count: 1 path: src/Controllers/Table/RelationController.php @@ -4714,13 +4714,13 @@ parameters: path: src/Controllers/Table/RelationController.php - - message: '#^Parameter \#3 \$destinationForeignTable of method PhpMyAdmin\\Table\\Table\:\:updateForeignKeys\(\) expects array\, mixed given\.$#' + message: '#^Parameter \#3 \$destinationForeignTable of method PhpMyAdmin\\Table\\Table\:\:updateForeignKeys\(\) expects array\, mixed given\.$#' identifier: argument.type count: 1 path: src/Controllers/Table/RelationController.php - - message: '#^Parameter \#3 \$destinationTable of method PhpMyAdmin\\Table\\Table\:\:updateInternalRelations\(\) expects array\, mixed given\.$#' + message: '#^Parameter \#3 \$destinationTable of method PhpMyAdmin\\Table\\Table\:\:updateInternalRelations\(\) expects array\, mixed given\.$#' identifier: argument.type count: 1 path: src/Controllers/Table/RelationController.php @@ -4732,13 +4732,13 @@ parameters: path: src/Controllers/Table/RelationController.php - - message: '#^Parameter \#4 \$destinationColumn of method PhpMyAdmin\\Table\\Table\:\:updateInternalRelations\(\) expects array\, mixed given\.$#' + message: '#^Parameter \#4 \$destinationColumn of method PhpMyAdmin\\Table\\Table\:\:updateInternalRelations\(\) expects array\, mixed given\.$#' identifier: argument.type count: 1 path: src/Controllers/Table/RelationController.php - - message: '#^Parameter \#4 \$destinationForeignColumn of method PhpMyAdmin\\Table\\Table\:\:updateForeignKeys\(\) expects array\, mixed given\.$#' + message: '#^Parameter \#4 \$destinationForeignColumn of method PhpMyAdmin\\Table\\Table\:\:updateForeignKeys\(\) expects array\\>, mixed given\.$#' identifier: argument.type count: 1 path: src/Controllers/Table/RelationController.php @@ -17133,18 +17133,6 @@ parameters: count: 1 path: src/Table/Search.php - - - message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#' - identifier: foreach.nonIterable - count: 1 - path: src/Table/Table.php - - - - message: '#^Binary operation "\." between string and mixed results in an error\.$#' - identifier: binaryOp.invalid - count: 1 - path: src/Table/Table.php - - message: '#^Binary operation "\.\=" between string and mixed results in an error\.$#' identifier: assignOp.invalid @@ -17235,12 +17223,6 @@ parameters: count: 3 path: src/Table/Table.php - - - message: '#^Cannot access offset mixed on mixed\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 5 - path: src/Table/Table.php - - message: '#^Cannot access offset string on mixed\.$#' identifier: offsetAccess.nonOffsetAccessible @@ -17283,18 +17265,6 @@ parameters: count: 1 path: src/Table/Table.php - - - message: '#^Method PhpMyAdmin\\Table\\Table\:\:getLastError\(\) should return string but returns mixed\.$#' - identifier: return.type - count: 1 - path: src/Table/Table.php - - - - message: '#^Method PhpMyAdmin\\Table\\Table\:\:getLastMessage\(\) should return string but returns mixed\.$#' - identifier: return.type - count: 1 - path: src/Table/Table.php - - message: '#^Method PhpMyAdmin\\Table\\Table\:\:getNameAndTypeOfTheColumns\(\) should return array\ but returns array\.$#' identifier: return.type @@ -17346,13 +17316,13 @@ parameters: - message: '#^Parameter \#1 \$identifier of static method PhpMyAdmin\\Util\:\:backquote\(\) expects string\|Stringable\|null, mixed given\.$#' identifier: argument.type - count: 5 + count: 2 path: src/Table/Table.php - - message: '#^Parameter \#1 \$str of method PhpMyAdmin\\DatabaseInterface\:\:quoteString\(\) expects string, mixed given\.$#' + message: '#^Parameter \#1 \$indexed of method PhpMyAdmin\\Table\\Table\:\:formatColumns\(\) expects array\, array\ given\.$#' identifier: argument.type - count: 9 + count: 2 path: src/Table/Table.php - @@ -17373,18 +17343,6 @@ parameters: count: 1 path: src/Table/Table.php - - - message: '#^Parameter \#2 \$array of function implode expects array\|null, mixed given\.$#' - identifier: argument.type - count: 1 - path: src/Table/Table.php - - - - message: '#^Parameter \#2 \$field of method PhpMyAdmin\\Table\\Table\:\:getSQLToCreateForeignKey\(\) expects array\, mixed given\.$#' - identifier: argument.type - count: 2 - path: src/Table/Table.php - - message: '#^Parameter \#2 \$string of function explode expects string, mixed given\.$#' identifier: argument.type @@ -17397,36 +17355,18 @@ parameters: count: 1 path: src/Table/Table.php - - - message: '#^Parameter \#3 \$foreignDb of method PhpMyAdmin\\Table\\Table\:\:getSQLToCreateForeignKey\(\) expects string, mixed given\.$#' - identifier: argument.type - count: 1 - path: src/Table/Table.php - - message: '#^Parameter \#3 \$foreignDb of method PhpMyAdmin\\Table\\Table\:\:getSQLToCreateForeignKey\(\) expects string, string\|null given\.$#' identifier: argument.type count: 1 path: src/Table/Table.php - - - message: '#^Parameter \#4 \$foreignTable of method PhpMyAdmin\\Table\\Table\:\:getSQLToCreateForeignKey\(\) expects string, mixed given\.$#' - identifier: argument.type - count: 1 - path: src/Table/Table.php - - message: '#^Parameter \#4 \$foreignTable of method PhpMyAdmin\\Table\\Table\:\:getSQLToCreateForeignKey\(\) expects string, string\|null given\.$#' identifier: argument.type count: 1 path: src/Table/Table.php - - - message: '#^Parameter \#5 \$foreignField of method PhpMyAdmin\\Table\\Table\:\:getSQLToCreateForeignKey\(\) expects array\, mixed given\.$#' - identifier: argument.type - count: 1 - path: src/Table/Table.php - - message: '#^Parameter \#6 \$name of method PhpMyAdmin\\Table\\Table\:\:getSQLToCreateForeignKey\(\) expects string\|null, mixed given\.$#' identifier: argument.type diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 524f464675..e1a7d70a5a 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -2982,15 +2982,17 @@ - - - + + + + + @@ -2998,8 +3000,6 @@ - - @@ -9925,27 +9925,11 @@ - - - - - - - - - - - - - - - - uiprefs[$property->value]]]> @@ -9953,9 +9937,8 @@ - - - + + dbName][$this->name]]]> @@ -9965,10 +9948,8 @@ - - @@ -9983,49 +9964,24 @@ - - - - - - - - - - - - - - - - - - - - - - - - errors)]]> - messages)]]> @@ -10059,6 +10015,11 @@ onDelete)]]> onUpdate)]]> + + + + + uiprefs =& $_SESSION['tmpval']['table_uiprefs'][$serverId][$this->dbName][$this->name]]]> diff --git a/src/Table/Table.php b/src/Table/Table.php index 79e17e9b75..b74b109b2a 100644 --- a/src/Table/Table.php +++ b/src/Table/Table.php @@ -69,10 +69,10 @@ class Table implements Stringable /** @var mixed[] UI preferences */ public array $uiprefs = []; - /** @var mixed[] errors occurred */ + /** @var string[] errors occurred */ public array $errors = []; - /** @var mixed[] messages */ + /** @var string[] messages */ public array $messages = []; private Relation $relation; @@ -939,9 +939,9 @@ class Table implements Stringable * * e.g. index(col1, col2) would return col1, col2 * - * @param mixed[] $indexed column data - * @param bool $backquoted whether to quote name with backticks `` - * @param bool $fullName whether to include full name of the table as a prefix + * @param string[] $indexed column data + * @param bool $backquoted whether to quote name with backticks `` + * @param bool $fullName whether to include full name of the table as a prefix * * @return string[] */ @@ -1355,11 +1355,11 @@ class Table implements Stringable /** * Function to get update query for updating internal relations * - * @param mixed[] $multiEditColumnsName multi edit column names - * @param mixed[] $destinationDb destination tables - * @param mixed[] $destinationTable destination tables - * @param mixed[] $destinationColumn destination columns - * @param mixed[]|null $existrel db, table, column + * @param string[] $multiEditColumnsName multi edit column names + * @param string[] $destinationDb destination tables + * @param (string|null)[] $destinationTable destination tables + * @param (string|null)[] $destinationColumn destination columns + * @param mixed[]|null $existrel db, table, column */ public function updateInternalRelations( array $multiEditColumnsName, @@ -1437,10 +1437,10 @@ class Table implements Stringable /** * Function to handle foreign key updates * - * @param mixed[] $destinationForeignDb destination foreign database - * @param mixed[] $multiEditColumnsName multi edit column names - * @param mixed[] $destinationForeignTable destination foreign table - * @param mixed[] $destinationForeignColumn destination foreign column + * @param string[] $destinationForeignDb destination foreign database + * @param string[][] $multiEditColumnsName multi edit column names + * @param string[] $destinationForeignTable destination foreign table + * @param string[][] $destinationForeignColumn destination foreign column * @param string[] $optionsArray options array * @param string $table current table * @param ForeignKey[] $existrelForeign db, table, column @@ -1616,10 +1616,10 @@ class Table implements Stringable * Returns the SQL query for foreign key constraint creation * * @param string $table table name - * @param mixed[] $field field names + * @param string[] $field field names * @param string $foreignDb foreign database name * @param string $foreignTable foreign table name - * @param mixed[] $foreignField foreign field names + * @param string[] $foreignField foreign field names * @param string|null $name name of the constraint * @param string|null $onDelete on delete action * @param string|null $onUpdate on update action