@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | * \details Provides a simpler way to initialize a database connection |
| 9 | 9 | * and create a PDO instance. |
| 10 | 10 | * @param $params Parameters for initialize connection. |
| 11 | - * @return True on success. |
|
| 11 | + * @return boolean on success. |
|
| 12 | 12 | */ |
| 13 | 13 | public function connect($params) { |
| 14 | 14 | try { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | /** \brief Add a user to the database. |
| 68 | 68 | * \details Add a user to the database in Bot::$user_table table and Bot::$id_column column using Bot::$pdo connection. |
| 69 | 69 | * @param $chat_id chat_id of the user to add. |
| 70 | - * @return True on success. |
|
| 70 | + * @return boolean on success. |
|
| 71 | 71 | */ |
| 72 | 72 | public function addUser($chat_id) : bool { |
| 73 | 73 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); |
| 19 | 19 | |
| 20 | 20 | return true; |
| 21 | - } catch(PDOException $e) { |
|
| 21 | + } catch (PDOException $e) { |
|
| 22 | 22 | echo 'Unable to connect to database, an error occured:' . $e->getMessage(); |
| 23 | 23 | } |
| 24 | 24 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | protected function mergeWithDefaults($params) { |
| 29 | - $DEFAULTS = [ 'adapter' => 'mysql', 'host' => 'localhost' ]; |
|
| 29 | + $DEFAULTS = ['adapter' => 'mysql', 'host' => 'localhost']; |
|
| 30 | 30 | return array_merge($DEFAULTS, $params); |
| 31 | 31 | } |
| 32 | 32 | |