Unverified Commit ed4ac2af authored by Sergei Morozov's avatar Sergei Morozov Committed by GitHub

Merge pull request #3865 from BenMorel/remove-andx

Remove ExpressionBuilder::andX()/orX()
parents f076cc75 e99812ef
# Upgrade to 4.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.
......
......@@ -60,26 +60,6 @@ class ExpressionBuilder
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.
*
......
......@@ -40,22 +40,6 @@ class ExpressionBuilderTest extends DbalTestCase
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[][]
*/
......@@ -113,22 +97,6 @@ class ExpressionBuilderTest extends DbalTestCase
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[][]
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment