Skip to content

Commit

Permalink
Fix 11: Remove dead code. (#400)
Browse files Browse the repository at this point in the history
* Remove dead code.
  • Loading branch information
terabytesoftw committed Dec 1, 2022
1 parent fcdf189 commit b3707d0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
3 changes: 0 additions & 3 deletions src/QueryBuilder/DMLQueryBuilder.php
Expand Up @@ -216,9 +216,6 @@ protected function prepareInsertValues(string $table, array|QueryInterface $colu

if ($value instanceof ExpressionInterface) {
$placeholders[] = $this->queryBuilder->buildExpression($value, $params);
} elseif ($value instanceof QueryInterface) {
[$sql, $params] = $this->queryBuilder->build($value, $params);
$placeholders[] = "($sql)";
} else {
$placeholders[] = $this->queryBuilder->bindParam($value, $params);
}
Expand Down
5 changes: 1 addition & 4 deletions src/QueryBuilder/DQLQueryBuilder.php
Expand Up @@ -348,7 +348,7 @@ public function buildSelect(
return $select . ' *';
}

/** @psalm-var array<array-key, ExpressionInterface|Query|string> $columns */
/** @psalm-var array<array-key, ExpressionInterface|string> $columns */
foreach ($columns as $i => $column) {
if ($column instanceof ExpressionInterface) {
if (is_int($i)) {
Expand All @@ -357,9 +357,6 @@ public function buildSelect(
$columns[$i] = $this->buildExpression($column, $params) . ' AS '
. $this->quoter->quoteColumnName($i);
}
} elseif ($column instanceof QueryInterface) {
[$sql, $params] = $this->build($column, $params);
$columns[$i] = "($sql) AS " . $this->quoter->quoteColumnName((string) $i);
} elseif (is_string($i) && $i !== $column) {
if (!str_contains($column, '(')) {
$column = $this->quoter->quoteColumnName($column);
Expand Down

0 comments on commit b3707d0

Please sign in to comment.