Skip to content

Commit

Permalink
Fix #18821: Additional type fixes (#19217)
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark authored Feb 9, 2022
1 parent 730f0e5 commit 9fbdc9f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
13 changes: 7 additions & 6 deletions framework/db/conditions/InConditionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace yii\db\conditions;

use yii\db\Expression;
use yii\db\ExpressionBuilderInterface;
use yii\db\ExpressionBuilderTrait;
use yii\db\ExpressionInterface;
Expand Down Expand Up @@ -66,7 +67,7 @@ public function build(ExpressionInterface $expression, array &$params = [])
$column = $column->current();
}

if ($column instanceof ExpressionInterface) {
if ($column instanceof Expression) {
$column = $column->expression;
}

Expand Down Expand Up @@ -128,7 +129,7 @@ protected function buildValues(ConditionInterface $condition, $values, &$params)
$column = $column->current();
}

if ($column instanceof ExpressionInterface) {
if ($column instanceof Expression) {
$column = $column->expression;
}

Expand Down Expand Up @@ -163,7 +164,7 @@ protected function buildSubqueryInCondition($operator, $columns, $values, &$para

if (is_array($columns)) {
foreach ($columns as $i => $col) {
if ($col instanceof ExpressionInterface) {
if ($col instanceof Expression) {
$col = $col->expression;
}
if (strpos($col, '(') === false) {
Expand All @@ -174,7 +175,7 @@ protected function buildSubqueryInCondition($operator, $columns, $values, &$para
return '(' . implode(', ', $columns) . ") $operator $sql";
}

if ($columns instanceof ExpressionInterface) {
if ($columns instanceof Expression) {
$columns = $columns->expression;
}
if (strpos($columns, '(') === false) {
Expand All @@ -199,7 +200,7 @@ protected function buildCompositeInCondition($operator, $columns, $values, &$par
foreach ($values as $value) {
$vs = [];
foreach ($columns as $column) {
if ($column instanceof ExpressionInterface) {
if ($column instanceof Expression) {
$column = $column->expression;
}
if (isset($value[$column])) {
Expand All @@ -217,7 +218,7 @@ protected function buildCompositeInCondition($operator, $columns, $values, &$par

$sqlColumns = [];
foreach ($columns as $i => $column) {
if ($column instanceof ExpressionInterface) {
if ($column instanceof Expression) {
$column = $column->expression;
}
$sqlColumns[] = strpos($column, '(') === false ? $this->queryBuilder->db->quoteColumnName($column) : $column;
Expand Down
6 changes: 3 additions & 3 deletions framework/db/mssql/conditions/InConditionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace yii\db\mssql\conditions;

use yii\base\NotSupportedException;
use yii\db\ExpressionInterface;
use yii\db\Expression;

/**
* {@inheritdoc}
Expand Down Expand Up @@ -38,7 +38,7 @@ protected function buildCompositeInCondition($operator, $columns, $values, &$par
{
$quotedColumns = [];
foreach ($columns as $i => $column) {
if ($column instanceof ExpressionInterface) {
if ($column instanceof Expression) {
$column = $column->expression;
}
$quotedColumns[$i] = strpos($column, '(') === false ? $this->queryBuilder->db->quoteColumnName($column) : $column;
Expand All @@ -47,7 +47,7 @@ protected function buildCompositeInCondition($operator, $columns, $values, &$par
foreach ($values as $value) {
$vs = [];
foreach ($columns as $i => $column) {
if ($column instanceof ExpressionInterface) {
if ($column instanceof Expression) {
$column = $column->expression;
}
if (isset($value[$column])) {
Expand Down
6 changes: 3 additions & 3 deletions framework/db/sqlite/conditions/InConditionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace yii\db\sqlite\conditions;

use yii\base\NotSupportedException;
use yii\db\ExpressionInterface;
use yii\db\Expression;

/**
* {@inheritdoc}
Expand Down Expand Up @@ -38,7 +38,7 @@ protected function buildCompositeInCondition($operator, $columns, $values, &$par
{
$quotedColumns = [];
foreach ($columns as $i => $column) {
if ($column instanceof ExpressionInterface) {
if ($column instanceof Expression) {
$column = $column->expression;
}
$quotedColumns[$i] = strpos($column, '(') === false ? $this->queryBuilder->db->quoteColumnName($column) : $column;
Expand All @@ -47,7 +47,7 @@ protected function buildCompositeInCondition($operator, $columns, $values, &$par
foreach ($values as $value) {
$vs = [];
foreach ($columns as $i => $column) {
if ($column instanceof ExpressionInterface) {
if ($column instanceof Expression) {
$column = $column->expression;
}
if (isset($value[$column])) {
Expand Down

0 comments on commit 9fbdc9f

Please sign in to comment.