From af955dab1c098ab048a41bfd933519eb5ce1ee03 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Mon, 5 May 2025 22:38:24 +0100 Subject: [PATCH 1/2] Fix incorrect type hint Signed-off-by: Kamil Tekiela --- src/Components/Key.php | 3 +-- src/Utils/ForeignKey.php | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Components/Key.php b/src/Components/Key.php index 99991930..fa0744d9 100644 --- a/src/Components/Key.php +++ b/src/Components/Key.php @@ -25,8 +25,7 @@ final class Key implements Component /** * The key columns * - * @var array> - * @phpstan-var array{name?: string, length?: int, order?: string}[] + * @var array{name?: string, length?: int, order?: string}[] */ public array $columns; diff --git a/src/Utils/ForeignKey.php b/src/Utils/ForeignKey.php index 54e294a0..50a08eb2 100644 --- a/src/Utils/ForeignKey.php +++ b/src/Utils/ForeignKey.php @@ -7,8 +7,8 @@ final class ForeignKey { /** - * @param (int|string)[] $indexList - * @param string[] $refIndexList + * @param string[] $indexList + * @param string[] $refIndexList */ public function __construct( public string|null $constraint = null, From 673d98dcf367bfc32cfdf7cb33056f8e7508f2ca Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Mon, 5 May 2025 22:42:11 +0100 Subject: [PATCH 2/2] Update psalm-baseline.xml Signed-off-by: Kamil Tekiela --- phpstan-baseline.neon | 24 ++--- psalm-baseline.xml | 214 +----------------------------------------- 2 files changed, 10 insertions(+), 228 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 43284b74..cc7bb264 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1194,12 +1194,6 @@ parameters: count: 1 path: src/Statements/CallStatement.php - - - message: '#^Binary operation "\.\=" between mixed and string results in an error\.$#' - identifier: assignOp.invalid - count: 1 - path: src/Statements/CreateStatement.php - - message: '#^Cannot access property \$database on PhpMyAdmin\\SqlParser\\Components\\Expression\|null\.$#' identifier: property.nonObject @@ -1710,18 +1704,6 @@ parameters: count: 1 path: src/Tools/ContextGenerator.php - - - message: '#^Offset 1 might not exist on array\{0\?\: string, 1\?\: non\-empty\-string, 2\?\: numeric\-string\}\.$#' - identifier: offsetAccess.notFound - count: 1 - path: src/Tools/ContextGenerator.php - - - - message: '#^Offset 2 might not exist on array\{0\?\: string, 1\?\: non\-empty\-string, 2\?\: numeric\-string\}\.$#' - identifier: offsetAccess.notFound - count: 1 - path: src/Tools/ContextGenerator.php - - message: '#^Parameter \#1 \$string of function trim expects string, mixed given\.$#' identifier: argument.type @@ -2910,6 +2892,12 @@ parameters: count: 2 path: tests/Utils/TableTest.php + - + message: '#^Call to method PhpMyAdmin\\SqlParser\\UtfString\:\:offsetGet\(\) on a separate line has no effect\.$#' + identifier: method.resultUnused + count: 4 + path: tests/benchmarks/UtfStringBench.php + - message: '#^Construct empty\(\) is not allowed\. Use more strict comparison\.$#' identifier: empty.notAllowed diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 1da89f1b..ce792f68 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + @@ -1155,61 +1155,6 @@ fields)]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1217,16 +1162,6 @@ - - - - - - - - - - @@ -1238,120 +1173,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -1379,42 +1205,10 @@ - - - - - - - - - - - - - - - - - - - - - - list]]> - - - - - - - - - -