You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Explicit type-hinting was added to the $connection variable: private PDO $connection;
Added type hints for all parameters.
Instead of echoing the PDOException message directly, the message is now being logged using error_log and then re-thrown: throw $e;
Insert now returns a string which represents the ID of the last inserted row or null if there's an issue.
If the select statement fails, an empty array is returned to the caller, indicating no results.
Update method was adjusted to return a bool to indicate the success or failure of the update operation.
Remove method was adjusted to return a bool to indicate the success or failure of the update operation.
CreateParameterString logic was streamlined for clarity, making use of a list of parts and then joining them together.
ExecuteStatement return type was changed to ?PDOStatement to allow for the possibility of a null return.
Exceptions caught within the method are now re-thrown after logging: throw new PDOException("Failed executing statement: {$e->getMessage()}");