aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2021-10-21 12:41:01 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2021-11-23 09:29:02 +0100
commit18a91f02fadf108bfa1a60f258ebacd2f802224b (patch)
treebf1871c6cbbb83e9c7afbeec8c83d17eb974ccad /lib
parent10dfdedcbd71c51fe3bd3532cb91762da3e84a58 (diff)
downloadnextcloud-server-18a91f02fadf108bfa1a60f258ebacd2f802224b.tar.gz
nextcloud-server-18a91f02fadf108bfa1a60f258ebacd2f802224b.zip
Fix default value for $type in OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::literal
This fixes PHP errors about passing null to PDO::quote second parameter. We may want to change IExpressionBuilder as well? Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php4
-rw-r--r--lib/public/DB/QueryBuilder/IExpressionBuilder.php4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php b/lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php
index c35afd0870b..77a4a02128a 100644
--- a/lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php
+++ b/lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php
@@ -414,11 +414,11 @@ class ExpressionBuilder implements IExpressionBuilder {
* Quotes a given input parameter.
*
* @param mixed $input The parameter to be quoted.
- * @param mixed|null $type One of the IQueryBuilder::PARAM_* constants
+ * @param int $type One of the IQueryBuilder::PARAM_* constants
*
* @return ILiteral
*/
- public function literal($input, $type = null): ILiteral {
+ public function literal($input, $type = IQueryBuilder::PARAM_STR): ILiteral {
return new Literal($this->expressionBuilder->literal($input, $type));
}
diff --git a/lib/public/DB/QueryBuilder/IExpressionBuilder.php b/lib/public/DB/QueryBuilder/IExpressionBuilder.php
index 77701240d51..4758fd06208 100644
--- a/lib/public/DB/QueryBuilder/IExpressionBuilder.php
+++ b/lib/public/DB/QueryBuilder/IExpressionBuilder.php
@@ -418,7 +418,7 @@ interface IExpressionBuilder {
* Quotes a given input parameter.
*
* @param mixed $input The parameter to be quoted.
- * @param mixed|null $type One of the IQueryBuilder::PARAM_* constants
+ * @param int $type One of the IQueryBuilder::PARAM_* constants
*
* @return ILiteral
* @since 8.2.0
@@ -426,7 +426,7 @@ interface IExpressionBuilder {
* @psalm-taint-sink sql $input
* @psalm-taint-sink sql $type
*/
- public function literal($input, $type = null): ILiteral;
+ public function literal($input, $type = IQueryBuilder::PARAM_STR): ILiteral;
/**
* Returns a IQueryFunction that casts the column to the given type