Browse Source

Merge pull request #10681 from inoas/patch-4

Class Connection true/false vs docblock
Mark Story 8 years ago
parent
commit
f9eb00b549
1 changed files with 3 additions and 5 deletions
  1. 3 5
      src/Database/Connection.php

+ 3 - 5
src/Database/Connection.php

@@ -213,15 +213,13 @@ class Connection implements ConnectionInterface
     /**
      * 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()]);
         }