Skip to content

Commit

Permalink
Fix psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed May 5, 2024
1 parent 216ece5 commit ccef4fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/DMLQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Yiisoft\Db\Query\QueryInterface;
use Yiisoft\Db\QueryBuilder\AbstractDMLQueryBuilder;

use function array_key_first;
use function array_map;
use function implode;
use function count;
Expand Down Expand Up @@ -164,7 +165,8 @@ protected function prepareInsertValues(string $table, array|QueryInterface $colu
if (!empty($tableSchema->getPrimaryKey())) {
$columns = $tableSchema->getPrimaryKey();
} else {
$columns = [current($tableSchema->getColumns())->getName()];
/** @var list<string> $columns */
$columns = [array_key_first($tableSchema->getColumns())];
}

foreach ($columns as $name) {
Expand Down

0 comments on commit ccef4fd

Please sign in to comment.