Passed
Push — master ( cf50a4...539dc8 )
by Mr
02:41 queued 34s
created
src/Database/Drivers/Mongo.php 1 patch
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,9 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function connect()
30 30
     {
31
-        if ($this->_connection) return;
31
+        if ($this->_connection) {
32
+            return;
33
+        }
32 34
 
33 35
         // Auth to database
34 36
         $userpass = isset($this->_config['username']) && isset($this->_config['password']) ? $this->_config['username'] . ':' . $this->_config['password'] . '@' : null;
@@ -91,7 +93,11 @@  discard block
 block discarded – undo
91 93
         try {
92 94
             $writeConcern = new \MongoDB\Driver\WriteConcern(\MongoDB\Driver\WriteConcern::MAJORITY, 1000);
93 95
             $this->_connection->executeBulkWrite($this->_config['database'] . '.' . $collection, $bulk, $writeConcern);
94
-            if ($command == 'insert') $response = (string) new \MongoDB\BSON\ObjectID($data['_id']); else $response = true;
96
+            if ($command == 'insert') {
97
+                $response = (string) new \MongoDB\BSON\ObjectID($data['_id']);
98
+            } else {
99
+                $response = true;
100
+            }
95 101
         } catch (\MongoDB\Driver\Exception\BulkWriteException $e) {
96 102
             error_log(
97 103
                 "Uncaught Error: " . $e->getMessage() . " in " . $e->getFile() . ":" . $e->getLine() . "\n"
Please login to merge, or discard this patch.