diff --git a/src/Adapter/Driver/ConnectionInterface.php b/src/Adapter/Driver/ConnectionInterface.php index 71506f7b..7af7a270 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 diff --git a/test/unit/Adapter/Driver/Pdo/TestAsset/TestConnection.php b/test/unit/Adapter/Driver/Pdo/TestAsset/TestConnection.php index 568a4a45..8d76e1e1 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 aa4addb7..6911391a 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