Skip to content

Commit

Permalink
Merge branch 'master' into params-type
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik authored Feb 18, 2024
2 parents 2ad20ae + 03dc434 commit f8d4841
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- Enh #801: Remove unnecessary symbol `\\` from `rtrim()` function inside `DbStringHelper::baseName()` method (@Tigrov)
- Bug #801: Fix bug with `Quoter::$tablePrefix` when change `AbstractConnection::$tablePrefix` property (@Tigrov)
- Enh #809: Add psalm type for parameters to bind to the SQL statement (@vjik)
- Enh #810: Add more specific psalm type for `QueryFunctionsInterface::count()` result (@vjik)

## 1.2.0 November 12, 2023

Expand Down
1 change: 1 addition & 0 deletions src/Query/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ public function count(string $sql = '*'): int|string
return 0;
}

/** @psalm-var non-negative-int|string */
return $count <= PHP_INT_MAX ? (int) $count : $count;
}

Expand Down
2 changes: 2 additions & 0 deletions src/Query/QueryFunctionsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public function average(string $sql): int|float|null|string;
* @return int|string Number of records. The result may be a string depending on the underlying database engine and
* to support integer values higher than a 32bit PHP integer can handle.
*
* @psalm-return non-negative-int|string
*
* Note: Make sure you quote column names in the expression.
*/
public function count(string $sql = '*'): int|string;
Expand Down

0 comments on commit f8d4841

Please sign in to comment.