diff options
author | Joas Schilling <coding@schilljs.com> | 2021-07-07 14:20:24 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-07-07 14:20:24 +0200 |
commit | aae16c21e66847cd12cbf3084a102b923a7717ce (patch) | |
tree | 865ae8349e342aefc00c29903b841ec4fdca7869 /lib | |
parent | 11d21e5f5c9e449a75ba24be9c018980496339e8 (diff) | |
download | nextcloud-server-aae16c21e66847cd12cbf3084a102b923a7717ce.tar.gz nextcloud-server-aae16c21e66847cd12cbf3084a102b923a7717ce.zip |
Allow casting query functions as well
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
4 files changed, 7 insertions, 7 deletions
diff --git a/lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php b/lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php index a837c1ad752..c35afd0870b 100644 --- a/lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php +++ b/lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php @@ -425,11 +425,11 @@ class ExpressionBuilder implements IExpressionBuilder { /** * Returns a IQueryFunction that casts the column to the given type * - * @param string $column + * @param string|IQueryFunction $column * @param mixed $type One of IQueryBuilder::PARAM_* * @return IQueryFunction */ - public function castColumn(string $column, $type): IQueryFunction { + public function castColumn($column, $type): IQueryFunction { return new QueryFunction( $this->helper->quoteColumnName($column) ); diff --git a/lib/private/DB/QueryBuilder/ExpressionBuilder/OCIExpressionBuilder.php b/lib/private/DB/QueryBuilder/ExpressionBuilder/OCIExpressionBuilder.php index 2a13562d00a..4cea234779e 100644 --- a/lib/private/DB/QueryBuilder/ExpressionBuilder/OCIExpressionBuilder.php +++ b/lib/private/DB/QueryBuilder/ExpressionBuilder/OCIExpressionBuilder.php @@ -161,11 +161,11 @@ class OCIExpressionBuilder extends ExpressionBuilder { /** * Returns a IQueryFunction that casts the column to the given type * - * @param string $column + * @param string|IQueryFunction $column * @param mixed $type One of IQueryBuilder::PARAM_* * @return IQueryFunction */ - public function castColumn(string $column, $type): IQueryFunction { + public function castColumn($column, $type): IQueryFunction { if ($type === IQueryBuilder::PARAM_STR) { $column = $this->helper->quoteColumnName($column); return new QueryFunction('to_char(' . $column . ')'); diff --git a/lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php b/lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php index 5df2f407411..4e0de5ef42b 100644 --- a/lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php +++ b/lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php @@ -33,7 +33,7 @@ class PgSqlExpressionBuilder extends ExpressionBuilder { /** * Returns a IQueryFunction that casts the column to the given type * - * @param string $column + * @param string|IQueryFunction $column * @param mixed $type One of IQueryBuilder::PARAM_* * @return IQueryFunction */ diff --git a/lib/public/DB/QueryBuilder/IExpressionBuilder.php b/lib/public/DB/QueryBuilder/IExpressionBuilder.php index b3dbf564e35..77701240d51 100644 --- a/lib/public/DB/QueryBuilder/IExpressionBuilder.php +++ b/lib/public/DB/QueryBuilder/IExpressionBuilder.php @@ -431,7 +431,7 @@ interface IExpressionBuilder { /** * Returns a IQueryFunction that casts the column to the given type * - * @param string $column + * @param string|IQueryFunction $column * @param mixed $type One of IQueryBuilder::PARAM_* * @return IQueryFunction * @since 9.0.0 @@ -439,5 +439,5 @@ interface IExpressionBuilder { * @psalm-taint-sink sql $column * @psalm-taint-sink sql $type */ - public function castColumn(string $column, $type): IQueryFunction; + public function castColumn($column, $type): IQueryFunction; } |