From 15a13a5fc7380625c4b990cfb8c3564f4cebd45c Mon Sep 17 00:00:00 2001 From: Tigrov Date: Wed, 6 Dec 2023 13:46:38 +0700 Subject: [PATCH 1/4] Fix `QueryBuilderTest::testBatchInsert()` --- tests/QueryBuilderTest.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/QueryBuilderTest.php b/tests/QueryBuilderTest.php index f5adf0b5..a54377ea 100644 --- a/tests/QueryBuilderTest.php +++ b/tests/QueryBuilderTest.php @@ -181,9 +181,14 @@ public function testAlterColumn(): void * @throws NotSupportedException * @throws Throwable */ - public function testBatchInsert(string $table, array $columns, iterable $rows, string $expected): void - { - parent::testBatchInsert($table, $columns, $rows, $expected); + public function testBatchInsert( + string $table, + array $columns, + iterable $rows, + string $expected, + array $expectedParams = [], + ): void { + parent::testBatchInsert($table, $columns, $rows, $expected, $expectedParams); } /** From b0319cdeefbda839e330478aeedd1dcc6e57d754 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Wed, 6 Dec 2023 18:50:12 +0700 Subject: [PATCH 2/4] Fix psalm issue --- src/Schema.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Schema.php b/src/Schema.php index cc88fcd4..23d46723 100644 --- a/src/Schema.php +++ b/src/Schema.php @@ -251,13 +251,12 @@ protected function loadTableForeignKeys(string $tableName): array * * @return array Indexes for the given table. * - * @psalm-return array|IndexConstraint[] + * @psalm-return IndexConstraint[] */ protected function loadTableIndexes(string $tableName): array { - $tableIndexes = $this->loadTableConstraints($tableName, self::INDEXES); - - return is_array($tableIndexes) ? $tableIndexes : []; + /** @var IndexConstraint[] */ + return $this->loadTableConstraints($tableName, self::INDEXES); } /** From 00465e7134067c277652571df4e7b7af8970afa8 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Thu, 7 Dec 2023 15:28:54 +0700 Subject: [PATCH 3/4] Add line to CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24aa252d..8d7d25aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Enh #281: Remove unused code in `Command` class (@vjik) - Enh #282: Change property `Schema::$typeMap` to constant `Schema::TYPE_MAP` (@Tigrov) +- Enh #283: Remove unnecessary check for `array` type (@Tigrov) ## 1.1.0 November 12, 2023 From 38844f350a2415c92d84a9f8660e145fae8b1152 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Thu, 7 Dec 2023 11:39:56 +0300 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d7d25aa..b78d56f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - Enh #281: Remove unused code in `Command` class (@vjik) - Enh #282: Change property `Schema::$typeMap` to constant `Schema::TYPE_MAP` (@Tigrov) -- Enh #283: Remove unnecessary check for `array` type (@Tigrov) +- Enh #283: Remove unnecessary check for array type in `Schema::loadTableIndexes()` (@Tigrov) ## 1.1.0 November 12, 2023