From b9ff4ba6c936761088402ae084fef29d3848b14a Mon Sep 17 00:00:00 2001 From: Tigrov Date: Sun, 14 Apr 2024 18:16:46 +0700 Subject: [PATCH] Fix psalm issues --- src/QueryBuilder/AbstractDMLQueryBuilder.php | 5 +++++ src/QueryBuilder/DMLQueryBuilderInterface.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/QueryBuilder/AbstractDMLQueryBuilder.php b/src/QueryBuilder/AbstractDMLQueryBuilder.php index 0db417372..645ea7b5f 100644 --- a/src/QueryBuilder/AbstractDMLQueryBuilder.php +++ b/src/QueryBuilder/AbstractDMLQueryBuilder.php @@ -142,6 +142,8 @@ public function upsert( * @param Traversable $rows The rows to be batch inserted into the table. * * @return array|Iterator The prepared rows. + * + * @psalm-return Iterator|array> */ protected function prepareTraversable(Traversable $rows): Iterator|array { @@ -153,6 +155,7 @@ protected function prepareTraversable(Traversable $rows): Iterator|array return []; } + /** @var Iterator $rows */ return $rows; } @@ -210,6 +213,8 @@ protected function prepareBatchInsertValues(string $table, iterable $rows, array * @param string[] $columns The column names. * * @return string[] The column names. + * + * @psalm-param Iterator|non-empty-array> $rows */ protected function extractColumnNames(array|Iterator $rows, array $columns): array { diff --git a/src/QueryBuilder/DMLQueryBuilderInterface.php b/src/QueryBuilder/DMLQueryBuilderInterface.php index 24aa4c856..e00113a57 100644 --- a/src/QueryBuilder/DMLQueryBuilderInterface.php +++ b/src/QueryBuilder/DMLQueryBuilderInterface.php @@ -45,7 +45,7 @@ interface DMLQueryBuilderInterface * @return string The batch INSERT SQL statement. * * @psalm-param string[] $columns - * @psalm-param iterable> $rows + * @psalm-param iterable> $rows * @psalm-param ParamsType $params * * Note: