|
21 | 21 | use Yiisoft\Db\Schema\ColumnSchemaInterface;
|
22 | 22 | use Yiisoft\Db\Schema\TableSchemaInterface;
|
23 | 23 |
|
| 24 | +use function array_change_key_case; |
| 25 | +use function array_map; |
24 | 26 | use function array_merge;
|
25 | 27 | use function array_reverse;
|
26 | 28 | use function implode;
|
@@ -208,7 +210,7 @@ protected function findTableNames(string $schema = ''): array
|
208 | 210 | /** @psalm-var string[][] $rows */
|
209 | 211 | foreach ($rows as $row) {
|
210 | 212 | /** @psalm-var string[] $row */
|
211 |
| - $row = $this->normalizeRowKeyCase($row, false); |
| 213 | + $row = array_change_key_case($row); |
212 | 214 | $names[] = $row['table_name'];
|
213 | 215 | }
|
214 | 216 |
|
@@ -287,7 +289,7 @@ protected function loadTableIndexes(string $tableName): array
|
287 | 289 | ])->queryAll();
|
288 | 290 |
|
289 | 291 | /** @psalm-var array[] $indexes */
|
290 |
| - $indexes = $this->normalizeRowKeyCase($indexes, true); |
| 292 | + $indexes = array_map('array_change_key_case', $indexes); |
291 | 293 | $indexes = DbArrayHelper::index($indexes, null, ['name']);
|
292 | 294 |
|
293 | 295 | $result = [];
|
@@ -406,7 +408,7 @@ protected function findColumns(TableSchemaInterface $table): bool
|
406 | 408 | /** @psalm-var string[][] $columns */
|
407 | 409 | foreach ($columns as $column) {
|
408 | 410 | /** @psalm-var ColumnInfoArray $column */
|
409 |
| - $column = $this->normalizeRowKeyCase($column, false); |
| 411 | + $column = array_change_key_case($column); |
410 | 412 |
|
411 | 413 | $c = $this->createColumnSchema($column);
|
412 | 414 |
|
@@ -554,7 +556,7 @@ protected function findConstraints(TableSchemaInterface $table): void
|
554 | 556 |
|
555 | 557 | foreach ($rows as $row) {
|
556 | 558 | /** @psalm-var string[] $row */
|
557 |
| - $row = $this->normalizeRowKeyCase($row, false); |
| 559 | + $row = array_change_key_case($row); |
558 | 560 |
|
559 | 561 | if ($row['constraint_type'] === 'P') {
|
560 | 562 | $table->getColumns()[$row['column_name']]->primaryKey(true);
|
@@ -715,7 +717,7 @@ private function loadTableConstraints(string $tableName, string $returnType): mi
|
715 | 717 | ])->queryAll();
|
716 | 718 |
|
717 | 719 | /** @psalm-var array[] $constraints */
|
718 |
| - $constraints = $this->normalizeRowKeyCase($constraints, true); |
| 720 | + $constraints = array_map('array_change_key_case', $constraints); |
719 | 721 | $constraints = DbArrayHelper::index($constraints, null, ['type', 'name']);
|
720 | 722 |
|
721 | 723 | $result = [
|
@@ -805,6 +807,8 @@ protected function findViewNames(string $schema = ''): array
|
805 | 807 | * @param string $name The table name.
|
806 | 808 | *
|
807 | 809 | * @return array The cache key.
|
| 810 | + * |
| 811 | + * @psalm-suppress DeprecatedMethod |
808 | 812 | */
|
809 | 813 | protected function getCacheKey(string $name): array
|
810 | 814 | {
|
|
0 commit comments