Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ExpressionBuilder::andX()/orX() #3865

Merged
merged 1 commit into from
Jan 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Upgrade to 3.0

## BC BREAK: Removed `ExpressionBuilder` methods

The `andX()` and `orX()` methods of the `ExpressionBuilder` class have been removed. Use `and()` and `or()` instead.

## BC BREAK: Removed `CompositeExpression` methods

The `add()` and `addMultiple()` methods of the `CompositeExpression` class have been removed. Use `with()` instead, which returns a new instance.
Expand Down
20 changes: 0 additions & 20 deletions lib/Doctrine/DBAL/Query/Expression/ExpressionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,6 @@ public function or($expression, ...$expressions) : CompositeExpression
return new CompositeExpression(CompositeExpression::TYPE_OR, array_merge([$expression], $expressions));
}

/**
* @deprecated Use `and()` instead.
*
* @param string|CompositeExpression ...$expressions Requires at least one defined when converting to string.
*/
public function andX(...$expressions) : CompositeExpression
{
return new CompositeExpression(CompositeExpression::TYPE_AND, $expressions);
}

/**
* @deprecated Use `or()` instead.
*
* @param string|CompositeExpression ...$expressions Requires at least one defined when converting to string.
*/
public function orX(...$expressions) : CompositeExpression
{
return new CompositeExpression(CompositeExpression::TYPE_OR, $expressions);
}

/**
* Creates a comparison expression.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,6 @@ public function testAnd(array $parts, string $expected) : void
self::assertEquals($expected, (string) $composite);
}

/**
* @param string[]|CompositeExpression[] $parts
*
* @dataProvider provideDataForAnd
*/
public function testAndX(array $parts, string $expected) : void
{
$composite = $this->expr->andX();

foreach ($parts as $part) {
$composite = $composite->with($part);
}

self::assertEquals($expected, (string) $composite);
}

/**
* @return mixed[][]
*/
Expand Down Expand Up @@ -113,22 +97,6 @@ public function testOr(array $parts, string $expected) : void
self::assertEquals($expected, (string) $composite);
}

/**
* @param string[]|CompositeExpression[] $parts
*
* @dataProvider provideDataForOr
*/
public function testOrX(array $parts, string $expected) : void
{
$composite = $this->expr->orX();

foreach ($parts as $part) {
$composite = $composite->with($part);
}

self::assertEquals($expected, (string) $composite);
}

/**
* @return mixed[][]
*/
Expand Down