Completed
Push — master ( 406a77...cc9072 )
by Bret R.
05:55
created
src/Check/MongoDbCheck.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace BretRZaun\StatusPage\Check;
3 3
 use MongoDB\Client;
4
-
5 4
 use BretRZaun\StatusPage\Result;
6 5
 
7 6
 class MongoDbCheck extends AbstractCheck
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             if (count($this->collections) > 0) {
43 43
                 $this->checkCollections($dbs);
44 44
             }
45
-        } catch(\Exception $e) {
45
+        } catch (\Exception $e) {
46 46
             $result->setError($e->getMessage());
47 47
         }
48 48
         return $result;
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
     private function checkDatabases($databases)
52 52
     {
53
-        foreach($this->databases as $database) {
53
+        foreach ($this->databases as $database) {
54 54
             if (!in_array($database, $databases)) {
55 55
                 throw new \RuntimeException('Database '.$database.' does not exist');
56 56
             }
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
 
60 60
     private function checkCollections(array $databases)
61 61
     {
62
-        foreach($this->collections as $databaseName => $collections) {
62
+        foreach ($this->collections as $databaseName => $collections) {
63 63
             $database = $this->client->selectDatabase($databaseName);
64 64
             $collectionNames = $database->listCollectionNames()->getArrayCopy();
65
-            foreach($collections as $collection) {
65
+            foreach ($collections as $collection) {
66 66
                 if (!in_array($collection, $collectionNames)) {
67 67
                     throw new \RuntimeException('Collection '.$collection.' does not exist in database '.$databaseName);
68 68
                 }
Please login to merge, or discard this patch.