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 05ebf54 commit 359a114
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Yiisoft\Db\Schema\TableSchemaInterface;

use function array_column;
use function array_map;
use function array_merge;
use function count;
use function explode;
Expand Down Expand Up @@ -201,7 +202,7 @@ protected function loadTableForeignKeys(string $tableName): array

$foreignKeysList = $this->getPragmaForeignKeyList($tableName);
/** @psalm-var ForeignKeyInfo[] $foreignKeysList */
$foreignKeysList = $this->normalizeRowKeyCase($foreignKeysList, true);
$foreignKeysList = array_map('array_change_key_case', $foreignKeysList);

Check failure on line 205 in src/Schema.php

View workflow job for this annotation

GitHub Actions / PHP 8.0

MixedArgument

src/Schema.php:205:63: MixedArgument: Argument 1 of array_change_key_case cannot be mixed, expecting array<array-key, mixed> (see https://psalm.dev/030)

Check failure on line 205 in src/Schema.php

View workflow job for this annotation

GitHub Actions / PHP 8.2

MixedArgument

src/Schema.php:205:63: MixedArgument: Argument 1 of array_change_key_case cannot be mixed, expecting array<array-key, mixed> (see https://psalm.dev/030)

Check failure on line 205 in src/Schema.php

View workflow job for this annotation

GitHub Actions / PHP 8.1

MixedArgument

src/Schema.php:205:63: MixedArgument: Argument 1 of array_change_key_case cannot be mixed, expecting array<array-key, mixed> (see https://psalm.dev/030)

Check failure on line 205 in src/Schema.php

View workflow job for this annotation

GitHub Actions / PHP 8.0

MixedArgument

src/Schema.php:205:63: MixedArgument: Argument 1 of array_change_key_case cannot be mixed, expecting array<array-key, mixed> (see https://psalm.dev/030)

Check failure on line 205 in src/Schema.php

View workflow job for this annotation

GitHub Actions / PHP 8.2

MixedArgument

src/Schema.php:205:63: MixedArgument: Argument 1 of array_change_key_case cannot be mixed, expecting array<array-key, mixed> (see https://psalm.dev/030)
$foreignKeysList = DbArrayHelper::index($foreignKeysList, null, ['table']);
DbArrayHelper::multisort($foreignKeysList, 'seq');

Expand Down Expand Up @@ -553,7 +554,7 @@ private function loadTableColumnsInfo(string $tableName): array
{
$tableColumns = $this->getPragmaTableInfo($tableName);
/** @psalm-var ColumnInfo[] $tableColumns */
$tableColumns = $this->normalizeRowKeyCase($tableColumns, true);
$tableColumns = array_map('array_change_key_case', $tableColumns);

/** @psalm-var ColumnInfo[] */
return DbArrayHelper::index($tableColumns, 'cid');
Expand All @@ -575,7 +576,7 @@ private function loadTableConstraints(string $tableName, string $returnType): Co
{
$indexList = $this->getPragmaIndexList($tableName);
/** @psalm-var IndexListInfo[] $indexes */
$indexes = $this->normalizeRowKeyCase($indexList, true);
$indexes = array_map('array_change_key_case', $indexList);

Check failure on line 579 in src/Schema.php

View workflow job for this annotation

GitHub Actions / PHP 8.0

MixedArgument

src/Schema.php:579:55: MixedArgument: Argument 1 of array_change_key_case cannot be mixed, expecting array<array-key, mixed> (see https://psalm.dev/030)

Check failure on line 579 in src/Schema.php

View workflow job for this annotation

GitHub Actions / PHP 8.2

MixedArgument

src/Schema.php:579:55: MixedArgument: Argument 1 of array_change_key_case cannot be mixed, expecting array<array-key, mixed> (see https://psalm.dev/030)

Check failure on line 579 in src/Schema.php

View workflow job for this annotation

GitHub Actions / PHP 8.1

MixedArgument

src/Schema.php:579:55: MixedArgument: Argument 1 of array_change_key_case cannot be mixed, expecting array<array-key, mixed> (see https://psalm.dev/030)

Check failure on line 579 in src/Schema.php

View workflow job for this annotation

GitHub Actions / PHP 8.0

MixedArgument

src/Schema.php:579:55: MixedArgument: Argument 1 of array_change_key_case cannot be mixed, expecting array<array-key, mixed> (see https://psalm.dev/030)

Check failure on line 579 in src/Schema.php

View workflow job for this annotation

GitHub Actions / PHP 8.2

MixedArgument

src/Schema.php:579:55: MixedArgument: Argument 1 of array_change_key_case cannot be mixed, expecting array<array-key, mixed> (see https://psalm.dev/030)
$result = [
self::PRIMARY_KEY => null,
self::INDEXES => [],
Expand Down Expand Up @@ -662,7 +663,7 @@ private function getPragmaIndexInfo(string $name): array
$column = $this->db
->createCommand('PRAGMA INDEX_INFO(' . (string) $this->db->getQuoter()->quoteValue($name) . ')')
->queryAll();
$column = $this->normalizeRowKeyCase($column, true);
$column = array_map('array_change_key_case', $column);
DbArrayHelper::multisort($column, 'seqno');

/** @psalm-var IndexInfo[] $column */
Expand Down Expand Up @@ -726,7 +727,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

0 comments on commit 359a114

Please sign in to comment.