From 7e7dadf4f27f99f33176c4b2c6105e6bb05cd4f6 Mon Sep 17 00:00:00 2001 From: Joey Smith Date: Fri, 9 Jan 2026 17:20:54 -0600 Subject: [PATCH 1/2] Fixes the param type for getLastGeneratedValue in ConnectionInterface Signed-off-by: Joey Smith Signed-off-by: Joey Smith --- src/Adapter/Driver/ConnectionInterface.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Adapter/Driver/ConnectionInterface.php b/src/Adapter/Driver/ConnectionInterface.php index 71506f7b5..7af7a2704 100644 --- a/src/Adapter/Driver/ConnectionInterface.php +++ b/src/Adapter/Driver/ConnectionInterface.php @@ -23,12 +23,9 @@ public function getConnectionParameters(): array; /** * Get last generated id * - * @param null $name Ignored (this is not ignored for PDO), imagine that... - * - * todo: narrow this to string|int|bool|null - * until version bumps to PHP 8.2 minimum then narrow to string|int|false + * $name Ignored (this is not ignored for PDO), imagine that... */ - public function getLastGeneratedValue($name = null): string|int|bool|null; + public function getLastGeneratedValue(?string $name = null): string|int|false; /** * Get resource From 2572f76ded201dbf3f66ab2147614e6949e57462 Mon Sep 17 00:00:00 2001 From: Joey Smith Date: Fri, 9 Jan 2026 17:30:09 -0600 Subject: [PATCH 2/2] CI fixes Signed-off-by: Joey Smith Signed-off-by: Joey Smith --- test/unit/Adapter/Driver/Pdo/TestAsset/TestConnection.php | 6 ++---- test/unit/TestAsset/ConnectionWrapper.php | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/test/unit/Adapter/Driver/Pdo/TestAsset/TestConnection.php b/test/unit/Adapter/Driver/Pdo/TestAsset/TestConnection.php index 568a4a455..8d76e1e14 100644 --- a/test/unit/Adapter/Driver/Pdo/TestAsset/TestConnection.php +++ b/test/unit/Adapter/Driver/Pdo/TestAsset/TestConnection.php @@ -52,11 +52,9 @@ private function buildDsn(): string }; } - /** - * @param string|null $name - */ + /** @phpstan-ignore return.unusedType */ #[Override] - public function getLastGeneratedValue($name = null): string|bool|null + public function getLastGeneratedValue(?string $name = null): string|int|false { return $this->resource?->lastInsertId($name) ?? null; } diff --git a/test/unit/TestAsset/ConnectionWrapper.php b/test/unit/TestAsset/ConnectionWrapper.php index aa4addb7e..6911391a2 100644 --- a/test/unit/TestAsset/ConnectionWrapper.php +++ b/test/unit/TestAsset/ConnectionWrapper.php @@ -29,9 +29,9 @@ public function getCurrentSchema(): string return 'test_schema'; } - public function getLastGeneratedValue(mixed $name = null): int|string|bool|null + public function getLastGeneratedValue(?string $name = null): string|int|false { - return null; + return false; } public function getNestedTransactionsCount(): int