Skip to content

Commit 7c75b7b

Browse files
authored
Call DbArrayHelper::arrange() instead of DbArrayHelper::index() (#350)
1 parent 4463878 commit 7c75b7b

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
- Enh #345: Refactor according changes in `db` package (@Tigrov)
3535
- New #344: Add `caseSensitive` option to like condition (@vjik)
3636
- Enh #347: Remove `getCacheKey()` and `getCacheTag()` methods from `Schema` class (@Tigrov)
37+
- Enh #350: Use `DbArrayHelper::arrange()` instead of `DbArrayHelper::index()` method (@Tigrov)
3738

3839
## 1.2.0 March 21, 2024
3940

src/Schema.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ protected function loadTableForeignKeys(string $tableName): array
158158

159159
$foreignKeysList = $this->getPragmaForeignKeyList($tableName);
160160
/** @psalm-var GroupedForeignKeyInfo $foreignKeysList */
161-
$foreignKeysList = DbArrayHelper::index($foreignKeysList, null, ['table', 'id']);
161+
$foreignKeysList = DbArrayHelper::arrange($foreignKeysList, ['table', 'id']);
162162

163163
foreach ($foreignKeysList as $table => $foreignKeysById) {
164164
/**
@@ -453,11 +453,8 @@ private function loadColumn(array $info): ColumnInterface
453453
private function loadTableColumnsInfo(string $tableName): array
454454
{
455455
$tableColumns = $this->getPragmaTableInfo($tableName);
456-
/** @psalm-var ColumnInfo[] $tableColumns */
457-
$tableColumns = array_map(array_change_key_case(...), $tableColumns);
458-
459456
/** @psalm-var ColumnInfo[] */
460-
return DbArrayHelper::index($tableColumns, 'cid');
457+
return array_map(array_change_key_case(...), $tableColumns);
461458
}
462459

463460
/**

0 commit comments

Comments
 (0)