diff --git a/src/DMLQueryBuilder.php b/src/DMLQueryBuilder.php index 4639d12..6b3a82a 100644 --- a/src/DMLQueryBuilder.php +++ b/src/DMLQueryBuilder.php @@ -15,6 +15,7 @@ use Yiisoft\Db\Query\QueryInterface; use Yiisoft\Db\QueryBuilder\AbstractDMLQueryBuilder; +use function array_map; use function implode; use function count; @@ -67,9 +68,10 @@ public function batchInsert(string $table, array $columns, iterable|Generator $r return ''; } - foreach ($columns as $i => $name) { - $columns[$i] = $this->quoter->quoteColumnName($name); - } + $columns = array_map( + [$this->quoter, 'quoteColumnName'], + $columns, + ); $tableAndColumns = ' INTO ' . $this->quoter->quoteTableName($table) . ' (' . implode(', ', $columns) . ') VALUES ';