Skip to content

Commit

Permalink
Merge pull request #10681 from inoas/patch-4
Browse files Browse the repository at this point in the history
Class Connection true/false vs docblock
  • Loading branch information
markstory committed May 22, 2017
2 parents 5b40f93 + bdcc586 commit f9eb00b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Database/Connection.php
Expand Up @@ -213,15 +213,13 @@ public function driver($driver = null, $config = [])
/**
* Connects to the configured database.
*
* @throws \Cake\Database\Exception\MissingConnectionException if credentials are invalid
* @return bool true on success or false if already connected.
* @throws \Cake\Database\Exception\MissingConnectionException if credentials are invalid.
* @return bool true, if the connection was already established or the attempt was successful.
*/
public function connect()
{
try {
$this->_driver->connect();

return true;
return $this->_driver->connect();
} catch (\Exception $e) {
throw new MissingConnectionException(['reason' => $e->getMessage()]);
}
Expand Down

0 comments on commit f9eb00b

Please sign in to comment.