Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Allow casting query functions as well
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen authored and backportbot[bot] committed Sep 24, 2021
commit 7c9167e9b425a2e97d25fab5f4a2fbddbd0d0118
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,11 @@ public function literal($input, $type = null): ILiteral {
/**
* 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)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ public function nonEmptyString($x): string {
/**
* 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 . ')');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/public/DB/QueryBuilder/IExpressionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,13 +431,13 @@ public function literal($input, $type = null): ILiteral;
/**
* 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
*
* @psalm-taint-sink sql $column
* @psalm-taint-sink sql $type
*/
public function castColumn(string $column, $type): IQueryFunction;
public function castColumn($column, $type): IQueryFunction;
}