mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 15:20:32 -04:00
Add type hints to DB connection class
This commit is contained in:
parent
49f5bc7641
commit
6a3a5d5ec3
1 changed files with 4 additions and 1 deletions
|
@ -56,6 +56,8 @@ class DbConnection{
|
|||
* @param array<mixed> $params An array of parameters to bind to the SQL statement.
|
||||
* @param string $class The type of object to return in the return array.
|
||||
* @return Array<mixed>
|
||||
* @throws Exceptions\DuplicateDatabaseKeyException When a unique key constraint has been violated.
|
||||
* @throws Exceptions\DatabaseQueryException When an error occurs during execution of the query.
|
||||
*/
|
||||
public function Query(string $sql, array $params = [], string $class = 'stdClass'): array{
|
||||
if($this->_link === null){
|
||||
|
@ -129,7 +131,7 @@ class DbConnection{
|
|||
}
|
||||
|
||||
/**
|
||||
* @param PdoException $ex The exception to create details from.
|
||||
* @param \PDOException $ex The exception to create details from.
|
||||
* @param string $preparedSql The prepared SQL that caused the exception.
|
||||
* @param array<mixed> $params The parameters passed to the prepared SQL.
|
||||
*/
|
||||
|
@ -140,6 +142,7 @@ class DbConnection{
|
|||
|
||||
/**
|
||||
* @return Array<mixed>
|
||||
* @throws \PDOException When an error occurs during execution of the query.
|
||||
*/
|
||||
private function ExecuteQuery(\PDOStatement $handle, string $class = 'stdClass'): array{
|
||||
$handle->execute();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue