diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 3bcd6ee47f..100d3064b1 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1610,11 +1610,6 @@ parameters: count: 2 path: src/Controllers/Database/DesignerController.php - - - message: "#^Parameter \\#1 \\$db of method PhpMyAdmin\\\\Database\\\\Designer\\:\\:getDatabaseTables\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/Controllers/Database/DesignerController.php - - message: "#^Parameter \\#1 \\$db of method PhpMyAdmin\\\\Database\\\\Designer\\:\\:getHtmlForEditOrDeletePages\\(\\) expects string, mixed given\\.$#" count: 2 @@ -1650,6 +1645,11 @@ parameters: count: 1 path: src/Controllers/Database/DesignerController.php + - + message: "#^Parameter \\#1 \\$db of static method PhpMyAdmin\\\\Url\\:\\:getHiddenInputs\\(\\) expects array\\|string, mixed given\\.$#" + count: 1 + path: src/Controllers/Database/DesignerController.php + - message: "#^Parameter \\#1 \\$index of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:saveSetting\\(\\) expects string, mixed given\\.$#" count: 1 @@ -1710,11 +1710,6 @@ parameters: count: 1 path: src/Controllers/Database/DesignerController.php - - - message: "#^Parameter \\#2 \\$getDb of method PhpMyAdmin\\\\Database\\\\Designer\\:\\:getHtmlForMain\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/Controllers/Database/DesignerController.php - - message: "#^Parameter \\#2 \\$table of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:getTablesInfo\\(\\) expects string\\|null, mixed given\\.$#" count: 2 @@ -6965,11 +6960,6 @@ parameters: count: 1 path: src/Database/Designer/Common.php - - - message: "#^Only booleans are allowed in a negated boolean, bool\\|string given\\.$#" - count: 1 - path: src/Database/Designer/Common.php - - message: "#^Only booleans are allowed in an if condition, PhpMyAdmin\\\\Dbal\\\\ResultInterface\\|false given\\.$#" count: 2 diff --git a/resources/templates/database/designer/database_tables.twig b/resources/templates/database/designer/database_tables.twig index 8521ce1ab7..a5ff03a078 100644 --- a/resources/templates/database/designer/database_tables.twig +++ b/resources/templates/database/designer/database_tables.twig @@ -70,12 +70,14 @@ designerTable.getTableName()|escape('url'), tab_column[t_n][j].name|url_encode ] %} - {% if not designerTable.supportsForeignkeys() %} - {% set click_field_param = click_field_param|merge([tables_pk_or_unique_keys[tmp_column] is defined ? 1 : 0]) %} - {% else %} - {# if foreign keys are supported, it's not necessary that the - index is a primary key #} - {% set click_field_param = click_field_param|merge([tables_all_keys[tmp_column] is defined ? 1 : 0]) %} + {% if tables_all_keys[tmp_column] is defined %} + {% if not designerTable.supportsForeignkeys() %} + {% set click_field_param = click_field_param|merge([tables_all_keys[tmp_column] ? 1 : 0]) %} + {% else %} + {# if foreign keys are supported, it's not necessary that the + index is a primary key #} + {% set click_field_param = click_field_param|merge([1]) %} + {% endif %} {% endif %} {% set click_field_param = click_field_param|merge([db]) %}