From 427d8a52264f74c0b544fed123efe747d4c820d6 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Thu, 17 Apr 2025 14:06:44 +0100 Subject: [PATCH] Update PHPStan Signed-off-by: Kamil Tekiela --- composer.lock | 10 ++++----- phpstan-baseline.neon | 52 ++----------------------------------------- src/Table/Table.php | 4 ++-- 3 files changed, 9 insertions(+), 57 deletions(-) diff --git a/composer.lock b/composer.lock index eab78aa36e..e6de028f23 100644 --- a/composer.lock +++ b/composer.lock @@ -5229,16 +5229,16 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.11", + "version": "2.1.12", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "8ca5f79a8f63c49b2359065832a654e1ec70ac30" + "reference": "96dde49e967c0c22812bcfa7bda4ff82c09f3b0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/8ca5f79a8f63c49b2359065832a654e1ec70ac30", - "reference": "8ca5f79a8f63c49b2359065832a654e1ec70ac30", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/96dde49e967c0c22812bcfa7bda4ff82c09f3b0c", + "reference": "96dde49e967c0c22812bcfa7bda4ff82c09f3b0c", "shasum": "" }, "require": { @@ -5283,7 +5283,7 @@ "type": "github" } ], - "time": "2025-03-24T13:45:00+00:00" + "time": "2025-04-16T13:19:18+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index e35dff0273..2f867066bf 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -8013,24 +8013,6 @@ parameters: count: 1 path: src/Git.php - - - message: '#^Offset 1 might not exist on array\{0\?\: string, 1\?\: non\-empty\-string, 2\?\: non\-empty\-string, 3\?\: numeric\-string, 4\?\: non\-falsy\-string\}\.$#' - identifier: offsetAccess.notFound - count: 1 - path: src/Git.php - - - - message: '#^Offset 2 might not exist on array\{0\?\: string, 1\?\: non\-empty\-string, 2\?\: non\-empty\-string, 3\?\: numeric\-string, 4\?\: non\-falsy\-string\}\.$#' - identifier: offsetAccess.notFound - count: 1 - path: src/Git.php - - - - message: '#^Offset 3 might not exist on array\{0\?\: string, 1\?\: non\-empty\-string, 2\?\: non\-empty\-string, 3\?\: numeric\-string, 4\?\: non\-falsy\-string\}\.$#' - identifier: offsetAccess.notFound - count: 1 - path: src/Git.php - - message: '#^Only booleans are allowed in an if condition, string\|false given\.$#' identifier: if.condNotBoolean @@ -8772,12 +8754,6 @@ parameters: count: 1 path: src/InsertEdit.php - - - message: '#^Offset 2 might not exist on array\{0\?\: string, 1\?\: string, 2\?\: string, 3\?\: numeric\-string\}\.$#' - identifier: offsetAccess.notFound - count: 1 - path: src/InsertEdit.php - - message: '#^Only booleans are allowed in &&, PhpMyAdmin\\Dbal\\ResultInterface\|false given on the left side\.$#' identifier: booleanAnd.leftNotBoolean @@ -11770,7 +11746,7 @@ parameters: path: src/Plugins/Import/ImportCsv.php - - message: '#^Parameter \#3 \$rows of class PhpMyAdmin\\Import\\ImportTable constructor expects list\\>, array\, array\> given\.$#' + message: '#^Parameter \#3 \$rows of class PhpMyAdmin\\Import\\ImportTable constructor expects list\\>, list\ given\.$#' identifier: argument.type count: 1 path: src/Plugins/Import/ImportCsv.php @@ -11878,7 +11854,7 @@ parameters: path: src/Plugins/Import/ImportOds.php - - message: '#^Parameter \#3 \$rows of class PhpMyAdmin\\Import\\ImportTable constructor expects list\\>, non\-empty\-array\, array\> given\.$#' + message: '#^Parameter \#3 \$rows of class PhpMyAdmin\\Import\\ImportTable constructor expects list\\>, non\-empty\-list\ given\.$#' identifier: argument.type count: 1 path: src/Plugins/Import/ImportOds.php @@ -14220,12 +14196,6 @@ parameters: count: 1 path: src/Server/Status/Monitor.php - - - message: '#^Offset 1 might not exist on array\{0\?\: string, 1\?\: non\-empty\-string\}\.$#' - identifier: offsetAccess.notFound - count: 1 - path: src/Server/Status/Monitor.php - - message: '#^Only booleans are allowed in a negated boolean, mixed given\.$#' identifier: booleanNot.exprNotBoolean @@ -16068,12 +16038,6 @@ parameters: count: 1 path: src/Util.php - - - message: '#^Offset 1 might not exist on array\{0\?\: string, 1\?\: string\}\.$#' - identifier: offsetAccess.notFound - count: 1 - path: src/Util.php - - message: '#^Offset int\<1, 6\> on array\{string, string, string, string, string, string, string\} in isset\(\) always exists and is not nullable\.$#' identifier: isset.offset @@ -16242,12 +16206,6 @@ parameters: count: 1 path: src/Utils/HttpRequest.php - - - message: '#^Offset 1 might not exist on array\{0\?\: string, 1\?\: numeric\-string\}\.$#' - identifier: offsetAccess.notFound - count: 1 - path: src/Utils/HttpRequest.php - - message: '#^Only booleans are allowed in an if condition, string\|false given\.$#' identifier: if.condNotBoolean @@ -17118,12 +17076,6 @@ parameters: count: 1 path: tests/unit/Config/FormDisplayTest.php - - - message: '#^Offset 1 might not exist on array\{0\?\: string, 1\?\: numeric\-string\}\.$#' - identifier: offsetAccess.notFound - count: 1 - path: tests/unit/Config/FormTest.php - - message: ''' #^Call to deprecated method getInstance\(\) of class PhpMyAdmin\\Config\: diff --git a/src/Table/Table.php b/src/Table/Table.php index c850c5b21b..cdc48bc6fd 100644 --- a/src/Table/Table.php +++ b/src/Table/Table.php @@ -1543,7 +1543,7 @@ class Table implements Stringable } } - $tmpErrorCreate = false; + $tmpErrorCreate = ''; if (! $create) { continue; } @@ -1586,7 +1586,7 @@ class Table implements Stringable // this is an alteration and the old constraint has been dropped // without creation of a new one - if (! $drop || $tmpErrorCreate === '' || $tmpErrorCreate === false) { + if (! $drop || $tmpErrorCreate === '') { continue; }