Skip to content

Commit

Permalink
[doctrineGH-3851] Trigger deprecation for ExpressionBuilder::andX/orX
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Mar 27, 2021
1 parent 69a67af commit d0b88d5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/Doctrine/DBAL/Query/Expression/ExpressionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Doctrine\DBAL\Query\Expression;

use Doctrine\DBAL\Connection;
use Doctrine\Deprecations\Deprecation;

use function func_get_arg;
use function func_get_args;
Expand Down Expand Up @@ -71,6 +72,12 @@ public function or($expression, ...$expressions): CompositeExpression
*/
public function andX($x = null)
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/3851',
'ExpressionBuilder::andX() is deprecated, use ExpressionBuilder::and() instead.'
);

return new CompositeExpression(CompositeExpression::TYPE_AND, func_get_args());
}

Expand All @@ -84,6 +91,12 @@ public function andX($x = null)
*/
public function orX($x = null)
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/3851',
'ExpressionBuilder::orX() is deprecated, use ExpressionBuilder::or() instead.'
);

return new CompositeExpression(CompositeExpression::TYPE_OR, func_get_args());
}

Expand Down

0 comments on commit d0b88d5

Please sign in to comment.