From 6a3a5d5ec3cf929b251ee25547b944d4a59ff8d5 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Mon, 29 Apr 2024 12:04:59 -0500 Subject: [PATCH] Add type hints to DB connection class --- lib/DbConnection.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/DbConnection.php b/lib/DbConnection.php index 8832c46d..66296ead 100644 --- a/lib/DbConnection.php +++ b/lib/DbConnection.php @@ -56,6 +56,8 @@ class DbConnection{ * @param array $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 + * @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 $params The parameters passed to the prepared SQL. */ @@ -140,6 +142,7 @@ class DbConnection{ /** * @return Array + * @throws \PDOException When an error occurs during execution of the query. */ private function ExecuteQuery(\PDOStatement $handle, string $class = 'stdClass'): array{ $handle->execute();