Skip to content

Commit be1c583

Browse files
authored
Remove "Condition" suffix from condition classes (#345)
1 parent f901ace commit be1c583

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
- Chg #330: Rename `insertWithReturningPks()` to `insertReturningPks()` in `Command` and `DMLQueryBuilder` classes (@Tigrov)
5454
- Enh #336: Provide `yiisoft/db-implementation` virtual package (@vjik)
5555
- Enh #340: Adapt to `Param` refactoring in `yiisoft/db` package (@vjik)
56-
- Enh #341, #342: Adapt to conditions refactoring in `yiisoft/db` package (@vjik)
56+
- Enh #341, #342, #345: Adapt to conditions refactoring in `yiisoft/db` package (@vjik)
5757

5858
## 1.3.0 March 21, 2024
5959

src/Builder/InConditionBuilder.php renamed to src/Builder/InBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@
99
use Yiisoft\Db\Exception\InvalidConfigException;
1010
use Yiisoft\Db\Exception\NotSupportedException;
1111
use Yiisoft\Db\Expression\ExpressionInterface;
12-
use Yiisoft\Db\QueryBuilder\Condition\InCondition;
12+
use Yiisoft\Db\QueryBuilder\Condition\In;
1313

1414
use function array_slice;
1515
use function array_unshift;
1616
use function count;
1717
use function is_array;
1818

1919
/**
20-
* Build an object of {@see InCondition} into SQL expressions for Oracle Server.
20+
* Build an object of {@see In} into SQL expressions for Oracle Server.
2121
*/
22-
final class InConditionBuilder extends \Yiisoft\Db\QueryBuilder\Condition\Builder\InConditionBuilder
22+
final class InBuilder extends \Yiisoft\Db\QueryBuilder\Condition\Builder\InBuilder
2323
{
2424
/**
2525
* The Method builds the raw SQL from the $expression that won't be additionally escaped or quoted.
2626
*
27-
* @param InCondition $expression The expression to build.
27+
* @param In $expression The expression to build.
2828
* @param array $params The binding parameters.
2929
*
3030
* @throws Exception
@@ -55,7 +55,7 @@ public function build(ExpressionInterface $expression, array &$params = []): str
5555
*
5656
* @return string|null `null` when split isn't required. Otherwise - built SQL condition.
5757
*/
58-
protected function splitCondition(InCondition $condition, array &$params): string|null
58+
protected function splitCondition(In $condition, array &$params): string|null
5959
{
6060
$operator = $condition->operator;
6161
$values = $condition->values;

src/Builder/LikeConditionBuilder.php renamed to src/Builder/LikeBuilder.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
namespace Yiisoft\Db\Oracle\Builder;
66

77
use Yiisoft\Db\Expression\ExpressionInterface;
8-
use Yiisoft\Db\QueryBuilder\Condition\LikeCondition;
8+
use Yiisoft\Db\QueryBuilder\Condition\Like;
99
use Yiisoft\Db\QueryBuilder\QueryBuilderInterface;
1010
use Yiisoft\Db\Schema\Quoter;
1111

1212
use function substr;
1313

1414
/**
15-
* Build an object of {@see LikeCondition} into SQL expressions for Oracle Server.
15+
* Build an object of {@see Like} into SQL expressions for Oracle Server.
1616
*/
17-
final class LikeConditionBuilder extends \Yiisoft\Db\QueryBuilder\Condition\Builder\LikeConditionBuilder
17+
final class LikeBuilder extends \Yiisoft\Db\QueryBuilder\Condition\Builder\LikeBuilder
1818
{
1919
private string $escapeCharacter = '!';
2020

2121
/**
22-
* `\` is initialized in {@see buildLikeCondition()} method since there is a need to choose replacement value
22+
* `\` is initialized in {@see buildLike()} method since there is a need to choose replacement value
2323
* based on {@see Quoter::quoteValue()}.
2424
*/
2525
protected array $escapingReplacements = [
@@ -46,7 +46,7 @@ public function build(ExpressionInterface $expression, array &$params = []): str
4646
return parent::build($expression, $params);
4747
}
4848

49-
protected function prepareColumn(LikeCondition $expression, array &$params): string
49+
protected function prepareColumn(Like $expression, array &$params): string
5050
{
5151
$column = parent::prepareColumn($expression, $params);
5252

@@ -59,7 +59,7 @@ protected function prepareColumn(LikeCondition $expression, array &$params): str
5959

6060
protected function preparePlaceholderName(
6161
string|ExpressionInterface $value,
62-
LikeCondition $expression,
62+
Like $expression,
6363
?array $escape,
6464
array &$params,
6565
): string {

src/DQLQueryBuilder.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
namespace Yiisoft\Db\Oracle;
66

77
use Yiisoft\Db\Expression\ExpressionInterface;
8-
use Yiisoft\Db\Oracle\Builder\InConditionBuilder;
9-
use Yiisoft\Db\Oracle\Builder\LikeConditionBuilder;
8+
use Yiisoft\Db\Oracle\Builder\InBuilder;
9+
use Yiisoft\Db\Oracle\Builder\LikeBuilder;
1010
use Yiisoft\Db\Query\Query;
1111
use Yiisoft\Db\QueryBuilder\AbstractDQLQueryBuilder;
12-
use Yiisoft\Db\QueryBuilder\Condition\InCondition;
13-
use Yiisoft\Db\QueryBuilder\Condition\LikeCondition;
12+
use Yiisoft\Db\QueryBuilder\Condition\In;
13+
use Yiisoft\Db\QueryBuilder\Condition\Like;
1414

1515
use function implode;
1616

@@ -83,8 +83,8 @@ protected function defaultExpressionBuilders(): array
8383
{
8484
return [
8585
...parent::defaultExpressionBuilders(),
86-
InCondition::class => InConditionBuilder::class,
87-
LikeCondition::class => LikeConditionBuilder::class,
86+
In::class => InBuilder::class,
87+
Like::class => LikeBuilder::class,
8888
];
8989
}
9090
}

0 commit comments

Comments
 (0)