Skip to content

Commit

Permalink
Resolve deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Jan 29, 2024
1 parent fa3c327 commit 88e21ef
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Yiisoft\Db\Schema\ColumnSchemaInterface;
use Yiisoft\Db\Schema\TableSchemaInterface;

use function array_change_key_case;
use function array_map;
use function array_merge;
use function array_values;
Expand Down Expand Up @@ -230,7 +231,7 @@ protected function findColumns(TableSchemaInterface $table): bool

/** @psalm-var ColumnInfoArray $info */
foreach ($columns as $info) {
$info = $this->normalizeRowKeyCase($info, false);
$info = array_change_key_case($info);

$info['extra_default_value'] = $columnsExtra[(string) $info['field']] ?? '';

Expand Down Expand Up @@ -412,7 +413,7 @@ protected function findViewNames(string $schema = ''): array
*/
protected function getCacheKey(string $name): array
{
return array_merge([self::class], $this->generateCacheKey(), [$this->getRawTableName($name)]);
return array_merge([self::class], $this->generateCacheKey(), [$this->db->getQuoter()->getRawTableName($name)]);
}

/**
Expand Down Expand Up @@ -675,7 +676,7 @@ private function loadTableConstraints(string $tableName, string $returnType): ar
])->queryAll();

/** @psalm-var array[][] $constraints */
$constraints = $this->normalizeRowKeyCase($constraints, true);
$constraints = array_map('array_change_key_case', $constraints);
$constraints = DbArrayHelper::index($constraints, null, ['type', 'name']);

$result = [
Expand Down Expand Up @@ -790,7 +791,7 @@ protected function loadTableIndexes(string $tableName): array
])->queryAll();

/** @psalm-var array[] $indexes */
$indexes = $this->normalizeRowKeyCase($indexes, true);
$indexes = array_map('array_change_key_case', $indexes);
$indexes = DbArrayHelper::index($indexes, null, ['name']);
$result = [];

Expand Down

0 comments on commit 88e21ef

Please sign in to comment.