Skip to content

Commit 0992809

Browse files
Tigrovvjik
andauthored
Fix QueryBuilderTest::testBatchInsert() (#283)
Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>
1 parent fd45a0b commit 0992809

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Enh #281: Remove unused code in `Command` class (@vjik)
66
- Enh #282: Change property `Schema::$typeMap` to constant `Schema::TYPE_MAP` (@Tigrov)
7+
- Enh #283: Remove unnecessary check for array type in `Schema::loadTableIndexes()` (@Tigrov)
78

89
## 1.1.0 November 12, 2023
910

src/Schema.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,12 @@ protected function loadTableForeignKeys(string $tableName): array
251251
*
252252
* @return array Indexes for the given table.
253253
*
254-
* @psalm-return array|IndexConstraint[]
254+
* @psalm-return IndexConstraint[]
255255
*/
256256
protected function loadTableIndexes(string $tableName): array
257257
{
258-
$tableIndexes = $this->loadTableConstraints($tableName, self::INDEXES);
259-
260-
return is_array($tableIndexes) ? $tableIndexes : [];
258+
/** @var IndexConstraint[] */
259+
return $this->loadTableConstraints($tableName, self::INDEXES);
261260
}
262261

263262
/**

tests/QueryBuilderTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,14 @@ public function testAlterColumn(): void
181181
* @throws NotSupportedException
182182
* @throws Throwable
183183
*/
184-
public function testBatchInsert(string $table, array $columns, iterable $rows, string $expected): void
185-
{
186-
parent::testBatchInsert($table, $columns, $rows, $expected);
184+
public function testBatchInsert(
185+
string $table,
186+
array $columns,
187+
iterable $rows,
188+
string $expected,
189+
array $expectedParams = [],
190+
): void {
191+
parent::testBatchInsert($table, $columns, $rows, $expected, $expectedParams);
187192
}
188193

189194
/**

0 commit comments

Comments
 (0)