summaryrefslogtreecommitdiffstats
path: root/lib/private/DB/QueryBuilder
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-03-13 09:35:09 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-03-13 09:35:09 +0100
commit46c195b58b6259fb8f9314b3846d26960a92d05c (patch)
tree33015f9f9e1fb7b58447a68e1579e9584ce7850c /lib/private/DB/QueryBuilder
parent0009358c17b4c84d94efc94ed91d097d11e4321a (diff)
downloadnextcloud-server-46c195b58b6259fb8f9314b3846d26960a92d05c.tar.gz
nextcloud-server-46c195b58b6259fb8f9314b3846d26960a92d05c.zip
Made IExpressionBuilder varadic
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/DB/QueryBuilder')
-rw-r--r--lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php14
1 files changed, 6 insertions, 8 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);
}