Skip to content

Commit b80d236

Browse files
committed
[doctrineGH-3851] Trigger deprecation for ExpressionBuilder::andX/orX
1 parent 5decef8 commit b80d236

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/Doctrine/DBAL/Query/Expression/ExpressionBuilder.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Doctrine\DBAL\Query\Expression;
44

55
use Doctrine\DBAL\Connection;
6+
use Doctrine\Deprecations\Deprecation;
67

78
use function func_get_arg;
89
use function func_get_args;
@@ -71,6 +72,12 @@ public function or($expression, ...$expressions): CompositeExpression
7172
*/
7273
public function andX($x = null)
7374
{
75+
Deprecation::trigger(
76+
'doctrine/dbal',
77+
'https://github.com/doctrine/dbal/pull/3851',
78+
'ExpressionBuilder::andX() is deprecated, use ExpressionBuilder::and() instead.'
79+
);
80+
7481
return new CompositeExpression(CompositeExpression::TYPE_AND, func_get_args());
7582
}
7683

@@ -84,6 +91,12 @@ public function andX($x = null)
8491
*/
8592
public function orX($x = null)
8693
{
94+
Deprecation::trigger(
95+
'doctrine/dbal',
96+
'https://github.com/doctrine/dbal/pull/3851',
97+
'ExpressionBuilder::orX() is deprecated, use ExpressionBuilder::or() instead.'
98+
);
99+
87100
return new CompositeExpression(CompositeExpression::TYPE_OR, func_get_args());
88101
}
89102

0 commit comments

Comments
 (0)