Completed
Push — master ( 4cb9f8...0f52bb )
by Filippo
02:33
created
Category
src/EoC/Server.php 1 patch
Braces   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -55,8 +55,9 @@  discard block
 block discarded – undo
55 55
     $this->monolog->pushHandler(new CouchHandler($this));
56 56
 
57 57
     // If a log file is provided, creates a stream handler to log debugging messages.
58
-    if (!empty($fileName))
59
-      $this->monolog->pushHandler(new StreamHandler($fileName, Logger::DEBUG));
58
+    if (!empty($fileName)) {
59
+          $this->monolog->pushHandler(new StreamHandler($fileName, Logger::DEBUG));
60
+    }
60 61
 
61 62
     // Get all available commands.
62 63
     $this->loadCommands();
@@ -109,13 +110,11 @@  discard block
 block discarded – undo
109 110
           $class = $this->commands[$cmd];
110 111
           $cmdObj = new $class($this, $args);
111 112
           $cmdObj->execute();
112
-        }
113
-        catch (\Exception $e) {
113
+        } catch (\Exception $e) {
114 114
           $this->monolog->addCritical($e->getMessage());
115 115
           exit(Server::EXIT_FAILURE);
116 116
         }
117
-      }
118
-      else {
117
+      } else {
119 118
         $this->monolog->addCritical(sprintf("'%s' command is not supported.", $cmd));
120 119
         exit(Server::EXIT_FAILURE);
121 120
       }
@@ -187,10 +186,11 @@  discard block
 block discarded – undo
187 186
 
188 187
       eval("\$closure = ".$fn);
189 188
 
190
-      if (is_callable($closure))
191
-        $reductions[] = call_user_func($closure, $keys, $values, $rereduce);
192
-      else
193
-        throw new \BadFunctionCallException("The reduce function is not callable.");
189
+      if (is_callable($closure)) {
190
+              $reductions[] = call_user_func($closure, $keys, $values, $rereduce);
191
+      } else {
192
+              throw new \BadFunctionCallException("The reduce function is not callable.");
193
+      }
194 194
     }
195 195
 
196 196
     // Sends mappings to CouchDB.
Please login to merge, or discard this patch.
src/EoC/Command/MapDocCmd.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,9 +78,9 @@
 block discarded – undo
78 78
       if (is_callable($closure)) {
79 79
         call_user_func($closure, $doc);
80 80
         $result[] = $map;
81
+      } else {
82
+              throw new \BadFunctionCallException("The map function is not callable.");
81 83
       }
82
-      else
83
-        throw new \BadFunctionCallException("The map function is not callable.");
84 84
     }
85 85
 
86 86
     // Sends mappings to CouchDB.
Please login to merge, or discard this patch.