From c8aee70a0b9d4f873a7327c13bb6b4763a6299a3 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 13 Mar 2018 08:07:08 +0100 Subject: [PATCH 01/11] Made select varadic Signed-off-by: Roeland Jago Douma --- lib/private/DB/QueryBuilder/QueryBuilder.php | 8 +++++--- lib/public/DB/QueryBuilder/IQueryBuilder.php | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php index d6f8bb48ac..c15470dcda 100644 --- a/lib/private/DB/QueryBuilder/QueryBuilder.php +++ b/lib/private/DB/QueryBuilder/QueryBuilder.php @@ -379,12 +379,14 @@ class QueryBuilder implements IQueryBuilder { * ->leftJoin('u', 'phonenumbers', 'p', 'u.id = p.user_id'); * * - * @param mixed $select The selection expressions. + * @param mixed ...$selects The selection expressions. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. */ - public function select($select = null) { - $selects = is_array($select) ? $select : func_get_args(); + public function select(...$selects) { + if (count($selects) === 1 && is_array($selects[0])) { + $selects = $selects[0]; + } $this->queryBuilder->select( $this->helper->quoteColumnNames($selects) diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php index 7f179dd7e2..70cc26f9a7 100644 --- a/lib/public/DB/QueryBuilder/IQueryBuilder.php +++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php @@ -292,12 +292,12 @@ interface IQueryBuilder { * ->leftJoin('u', 'phonenumbers', 'p', 'u.id = p.user_id'); * * - * @param mixed $select The selection expressions. + * @param mixed ...$selects The selection expressions. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. * @since 8.2.0 */ - public function select($select = null); + public function select(...$selects); /** * Specifies an item that is to be returned with a different name in the query result. From 2976b3910251b18a039b663433a95e2cccaec5e9 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 13 Mar 2018 09:25:32 +0100 Subject: [PATCH 02/11] Made AddSelect varadic Signed-off-by: Roeland Jago Douma --- lib/private/DB/QueryBuilder/QueryBuilder.php | 8 +++++--- lib/public/DB/QueryBuilder/IQueryBuilder.php | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php index c15470dcda..4b3fd8449c 100644 --- a/lib/private/DB/QueryBuilder/QueryBuilder.php +++ b/lib/private/DB/QueryBuilder/QueryBuilder.php @@ -452,12 +452,14 @@ class QueryBuilder implements IQueryBuilder { * ->leftJoin('u', 'phonenumbers', 'u.id = p.user_id'); * * - * @param mixed $select The selection expression. + * @param mixed ...$selects The selection expression. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. */ - public function addSelect($select = null) { - $selects = is_array($select) ? $select : func_get_args(); + public function addSelect(...$selects) { + if (count($selects) === 1 && is_array($selects[0])) { + $selects = $selects[0]; + } $this->queryBuilder->addSelect( $this->helper->quoteColumnNames($selects) diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php index 70cc26f9a7..760496064f 100644 --- a/lib/public/DB/QueryBuilder/IQueryBuilder.php +++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php @@ -344,12 +344,12 @@ interface IQueryBuilder { * ->leftJoin('u', 'phonenumbers', 'u.id = p.user_id'); * * - * @param mixed $select The selection expression. + * @param mixed ...$select The selection expression. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. * @since 8.2.0 */ - public function addSelect($select = null); + public function addSelect(...$select); /** * Turns the query being built into a bulk delete query that ranges over From 222dbb7bc9aa4424a78da93690f6262dd57347a3 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 13 Mar 2018 09:27:11 +0100 Subject: [PATCH 03/11] Made where varadic Signed-off-by: Roeland Jago Douma --- lib/private/DB/QueryBuilder/QueryBuilder.php | 6 +++--- lib/public/DB/QueryBuilder/IQueryBuilder.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php index 4b3fd8449c..a67e379617 100644 --- a/lib/private/DB/QueryBuilder/QueryBuilder.php +++ b/lib/private/DB/QueryBuilder/QueryBuilder.php @@ -729,14 +729,14 @@ class QueryBuilder implements IQueryBuilder { * ->where($or); * * - * @param mixed $predicates The restriction predicates. + * @param mixed ...$predicates The restriction predicates. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. */ - public function where($predicates) { + public function where(...$predicates) { call_user_func_array( [$this->queryBuilder, 'where'], - func_get_args() + $predicates ); return $this; diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php index 760496064f..3d612b3a3a 100644 --- a/lib/public/DB/QueryBuilder/IQueryBuilder.php +++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php @@ -554,7 +554,7 @@ interface IQueryBuilder { * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. * @since 8.2.0 */ - public function where($predicates); + public function where(...$predicates); /** * Adds one or more restrictions to the query results, forming a logical From 07cb6aaeff6c2b82265f078178384f2674ca24f3 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 13 Mar 2018 09:27:43 +0100 Subject: [PATCH 04/11] Made andWhere varadic Signed-off-by: Roeland Jago Douma --- lib/private/DB/QueryBuilder/QueryBuilder.php | 6 +++--- lib/public/DB/QueryBuilder/IQueryBuilder.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php index a67e379617..25f21f3c56 100644 --- a/lib/private/DB/QueryBuilder/QueryBuilder.php +++ b/lib/private/DB/QueryBuilder/QueryBuilder.php @@ -754,16 +754,16 @@ class QueryBuilder implements IQueryBuilder { * ->andWhere('u.is_active = 1'); * * - * @param mixed $where The query restrictions. + * @param mixed ...$where The query restrictions. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. * * @see where() */ - public function andWhere($where) { + public function andWhere(...$where) { call_user_func_array( [$this->queryBuilder, 'andWhere'], - func_get_args() + $where ); return $this; diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php index 3d612b3a3a..5d6aadc13e 100644 --- a/lib/public/DB/QueryBuilder/IQueryBuilder.php +++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php @@ -575,7 +575,7 @@ interface IQueryBuilder { * @see where() * @since 8.2.0 */ - public function andWhere($where); + public function andWhere(...$where); /** * Adds one or more restrictions to the query results, forming a logical From d6b93e662024c35d02e8762d04c726c84c6c454a Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 13 Mar 2018 09:28:27 +0100 Subject: [PATCH 05/11] Made orWhere varadic Signed-off-by: Roeland Jago Douma --- lib/private/DB/QueryBuilder/QueryBuilder.php | 6 +++--- lib/public/DB/QueryBuilder/IQueryBuilder.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php index 25f21f3c56..0d0e6594b5 100644 --- a/lib/private/DB/QueryBuilder/QueryBuilder.php +++ b/lib/private/DB/QueryBuilder/QueryBuilder.php @@ -781,16 +781,16 @@ class QueryBuilder implements IQueryBuilder { * ->orWhere('u.id = 2'); * * - * @param mixed $where The WHERE statement. + * @param mixed ...$where The WHERE statement. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. * * @see where() */ - public function orWhere($where) { + public function orWhere(...$where) { call_user_func_array( [$this->queryBuilder, 'orWhere'], - func_get_args() + $where ); return $this; diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php index 5d6aadc13e..876e77378e 100644 --- a/lib/public/DB/QueryBuilder/IQueryBuilder.php +++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php @@ -568,7 +568,7 @@ interface IQueryBuilder { * ->andWhere('u.is_active = 1'); * * - * @param mixed $where The query restrictions. + * @param mixed ...$where The query restrictions. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. * @@ -589,14 +589,14 @@ interface IQueryBuilder { * ->orWhere('u.id = 2'); * * - * @param mixed $where The WHERE statement. + * @param mixed ...$where The WHERE statement. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. * * @see where() * @since 8.2.0 */ - public function orWhere($where); + public function orWhere(...$where); /** * Specifies a grouping over the results of the query. From afbad7e15ea1dc578d2af171b820d35c34899eb4 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 13 Mar 2018 09:29:36 +0100 Subject: [PATCH 06/11] Made groupBy varadic Signed-off-by: Roeland Jago Douma --- lib/private/DB/QueryBuilder/QueryBuilder.php | 8 +++++--- lib/public/DB/QueryBuilder/IQueryBuilder.php | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php index 0d0e6594b5..25e879b82b 100644 --- a/lib/private/DB/QueryBuilder/QueryBuilder.php +++ b/lib/private/DB/QueryBuilder/QueryBuilder.php @@ -807,12 +807,14 @@ class QueryBuilder implements IQueryBuilder { * ->groupBy('u.id'); * * - * @param mixed $groupBy The grouping expression. + * @param mixed ...$groupBys The grouping expression. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. */ - public function groupBy($groupBy) { - $groupBys = is_array($groupBy) ? $groupBy : func_get_args(); + public function groupBy(...$groupBys) { + if (count($groupBys) === 1 && is_array($groupBys[0])) { + $$groupBys = $groupBys[0]; + } call_user_func_array( [$this->queryBuilder, 'groupBy'], diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php index 876e77378e..4f335c13c4 100644 --- a/lib/public/DB/QueryBuilder/IQueryBuilder.php +++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php @@ -609,12 +609,12 @@ interface IQueryBuilder { * ->groupBy('u.id'); * * - * @param mixed $groupBy The grouping expression. + * @param mixed ...$groupBys The grouping expression. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. * @since 8.2.0 */ - public function groupBy($groupBy); + public function groupBy(...$groupBys); /** * Adds a grouping expression to the query. From c6eba3c925cbdd7d305a21588af421ca5e6986f9 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 13 Mar 2018 09:30:14 +0100 Subject: [PATCH 07/11] Made addGroupBy varadic Signed-off-by: Roeland Jago Douma --- lib/private/DB/QueryBuilder/QueryBuilder.php | 8 +++++--- lib/public/DB/QueryBuilder/IQueryBuilder.php | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php index 25e879b82b..57a0e1babd 100644 --- a/lib/private/DB/QueryBuilder/QueryBuilder.php +++ b/lib/private/DB/QueryBuilder/QueryBuilder.php @@ -835,12 +835,14 @@ class QueryBuilder implements IQueryBuilder { * ->addGroupBy('u.createdAt') * * - * @param mixed $groupBy The grouping expression. + * @param mixed ...$groupBy The grouping expression. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. */ - public function addGroupBy($groupBy) { - $groupBys = is_array($groupBy) ? $groupBy : func_get_args(); + public function addGroupBy(...$groupBys) { + if (count($groupBys) === 1 && is_array($groupBys[0])) { + $$groupBys = $groupBys[0]; + } call_user_func_array( [$this->queryBuilder, 'addGroupBy'], diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php index 4f335c13c4..e6f4b43c24 100644 --- a/lib/public/DB/QueryBuilder/IQueryBuilder.php +++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php @@ -627,12 +627,12 @@ interface IQueryBuilder { * ->addGroupBy('u.createdAt') * * - * @param mixed $groupBy The grouping expression. + * @param mixed ...$groupBy The grouping expression. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. * @since 8.2.0 */ - public function addGroupBy($groupBy); + public function addGroupBy(...$groupBy); /** * Sets a value for a column in an insert query. From 2c585afea1f0835566ff4bbad027aa57b5564afb Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 13 Mar 2018 09:31:04 +0100 Subject: [PATCH 08/11] Make having varadic Signed-off-by: Roeland Jago Douma --- lib/private/DB/QueryBuilder/QueryBuilder.php | 6 +++--- lib/public/DB/QueryBuilder/IQueryBuilder.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php index 57a0e1babd..86e3eac14f 100644 --- a/lib/private/DB/QueryBuilder/QueryBuilder.php +++ b/lib/private/DB/QueryBuilder/QueryBuilder.php @@ -914,14 +914,14 @@ class QueryBuilder implements IQueryBuilder { * Specifies a restriction over the groups of the query. * Replaces any previous having restrictions, if any. * - * @param mixed $having The restriction over the groups. + * @param mixed ...$having The restriction over the groups. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. */ - public function having($having) { + public function having(...$having) { call_user_func_array( [$this->queryBuilder, 'having'], - func_get_args() + $having ); return $this; diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php index e6f4b43c24..aec8e26477 100644 --- a/lib/public/DB/QueryBuilder/IQueryBuilder.php +++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php @@ -682,12 +682,12 @@ interface IQueryBuilder { * Specifies a restriction over the groups of the query. * Replaces any previous having restrictions, if any. * - * @param mixed $having The restriction over the groups. + * @param mixed ...$having The restriction over the groups. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. * @since 8.2.0 */ - public function having($having); + public function having(...$having); /** * Adds a restriction over the groups of the query, forming a logical From 408c2103db9dd5d981873544701cb69d01ffba9c Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 13 Mar 2018 09:31:33 +0100 Subject: [PATCH 09/11] Made addHaving varadic Signed-off-by: Roeland Jago Douma --- lib/private/DB/QueryBuilder/QueryBuilder.php | 6 +++--- lib/public/DB/QueryBuilder/IQueryBuilder.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php index 86e3eac14f..3c29728386 100644 --- a/lib/private/DB/QueryBuilder/QueryBuilder.php +++ b/lib/private/DB/QueryBuilder/QueryBuilder.php @@ -931,14 +931,14 @@ class QueryBuilder implements IQueryBuilder { * Adds a restriction over the groups of the query, forming a logical * conjunction with any existing having restrictions. * - * @param mixed $having The restriction to append. + * @param mixed ...$having The restriction to append. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. */ - public function andHaving($having) { + public function andHaving(...$having) { call_user_func_array( [$this->queryBuilder, 'andHaving'], - func_get_args() + $having ); return $this; diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php index aec8e26477..c27a0cb964 100644 --- a/lib/public/DB/QueryBuilder/IQueryBuilder.php +++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php @@ -693,12 +693,12 @@ interface IQueryBuilder { * Adds a restriction over the groups of the query, forming a logical * conjunction with any existing having restrictions. * - * @param mixed $having The restriction to append. + * @param mixed ...$having The restriction to append. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. * @since 8.2.0 */ - public function andHaving($having); + public function andHaving(...$having); /** * Adds a restriction over the groups of the query, forming a logical From 0009358c17b4c84d94efc94ed91d097d11e4321a Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 13 Mar 2018 09:32:31 +0100 Subject: [PATCH 10/11] Made orHaving varadic Signed-off-by: Roeland Jago Douma --- lib/private/DB/QueryBuilder/QueryBuilder.php | 6 +++--- lib/public/DB/QueryBuilder/IQueryBuilder.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php index 3c29728386..3cb7ba133d 100644 --- a/lib/private/DB/QueryBuilder/QueryBuilder.php +++ b/lib/private/DB/QueryBuilder/QueryBuilder.php @@ -948,14 +948,14 @@ class QueryBuilder implements IQueryBuilder { * Adds a restriction over the groups of the query, forming a logical * disjunction with any existing having restrictions. * - * @param mixed $having The restriction to add. + * @param mixed ...$having The restriction to add. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. */ - public function orHaving($having) { + public function orHaving(...$having) { call_user_func_array( [$this->queryBuilder, 'orHaving'], - func_get_args() + $having ); return $this; diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php index c27a0cb964..7fea31f468 100644 --- a/lib/public/DB/QueryBuilder/IQueryBuilder.php +++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php @@ -704,12 +704,12 @@ interface IQueryBuilder { * Adds a restriction over the groups of the query, forming a logical * disjunction with any existing having restrictions. * - * @param mixed $having The restriction to add. + * @param mixed ...$having The restriction to add. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. * @since 8.2.0 */ - public function orHaving($having); + public function orHaving(...$having); /** * Specifies an ordering for the query results. From 46c195b58b6259fb8f9314b3846d26960a92d05c Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 13 Mar 2018 09:35:09 +0100 Subject: [PATCH 11/11] Made IExpressionBuilder varadic Signed-off-by: Roeland Jago Douma --- .../ExpressionBuilder/ExpressionBuilder.php | 14 ++++++-------- lib/public/DB/QueryBuilder/IExpressionBuilder.php | 8 ++++---- 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 154f2447c7..6e4a206183 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 eab93b52f8..0a212e8f82 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.