summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php14
-rw-r--r--lib/public/DB/QueryBuilder/IExpressionBuilder.php8
2 files changed, 10 insertions, 12 deletions
diff --git a/lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php b/lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php
index 154f2447c77..6e4a2061832 100644
--- a/lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php
+++ b/lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php
@@ -71,14 +71,13 @@ class ExpressionBuilder implements IExpressionBuilder {
* // (u.type = ?) AND (u.role = ?)
* $expr->andX('u.type = ?', 'u.role = ?'));
*
- * @param mixed $x Optional clause. Defaults = null, but requires
+ * @param mixed ...$x Optional clause. Defaults = null, but requires
* at least one defined when converting to string.
*
* @return \OCP\DB\QueryBuilder\ICompositeExpression
*/
- public function andX($x = null) {
- $arguments = func_get_args();
- $compositeExpression = call_user_func_array([$this->expressionBuilder, 'andX'], $arguments);
+ public function andX(...$x) {
+ $compositeExpression = call_user_func_array([$this->expressionBuilder, 'andX'], $x);
return new CompositeExpression($compositeExpression);
}
@@ -91,14 +90,13 @@ class ExpressionBuilder implements IExpressionBuilder {
* // (u.type = ?) OR (u.role = ?)
* $qb->where($qb->expr()->orX('u.type = ?', 'u.role = ?'));
*
- * @param mixed $x Optional clause. Defaults = null, but requires
+ * @param mixed ...$x Optional clause. Defaults = null, but requires
* at least one defined when converting to string.
*
* @return \OCP\DB\QueryBuilder\ICompositeExpression
*/
- public function orX($x = null) {
- $arguments = func_get_args();
- $compositeExpression = call_user_func_array([$this->expressionBuilder, 'orX'], $arguments);
+ public function orX(...$x) {
+ $compositeExpression = call_user_func_array([$this->expressionBuilder, 'orX'], $x);
return new CompositeExpression($compositeExpression);
}
diff --git a/lib/public/DB/QueryBuilder/IExpressionBuilder.php b/lib/public/DB/QueryBuilder/IExpressionBuilder.php
index eab93b52f8a..0a212e8f828 100644
--- a/lib/public/DB/QueryBuilder/IExpressionBuilder.php
+++ b/lib/public/DB/QueryBuilder/IExpressionBuilder.php
@@ -66,13 +66,13 @@ interface IExpressionBuilder {
* // (u.type = ?) AND (u.role = ?)
* $expr->andX('u.type = ?', 'u.role = ?'));
*
- * @param mixed $x Optional clause. Defaults = null, but requires
+ * @param mixed ...$x Optional clause. Defaults = null, but requires
* at least one defined when converting to string.
*
* @return \OCP\DB\QueryBuilder\ICompositeExpression
* @since 8.2.0
*/
- public function andX($x = null);
+ public function andX(...$x);
/**
* Creates a disjunction of the given boolean expressions.
@@ -83,13 +83,13 @@ interface IExpressionBuilder {
* // (u.type = ?) OR (u.role = ?)
* $qb->where($qb->expr()->orX('u.type = ?', 'u.role = ?'));
*
- * @param mixed $x Optional clause. Defaults = null, but requires
+ * @param mixed ...$x Optional clause. Defaults = null, but requires
* at least one defined when converting to string.
*
* @return \OCP\DB\QueryBuilder\ICompositeExpression
* @since 8.2.0
*/
- public function orX($x = null);
+ public function orX(...$x);
/**
* Creates a comparison expression.