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 6, 2021
1 parent 3f0e898 commit e3fc3f5
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 e3fc3f5

Please sign in to comment.