Passed
Push — master ( dae34e...b269c0 )
by Ioannes
01:25
created
src/Log.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     public function __construct($channel = '') {
21 21
 
22 22
         $this->minDebugLevel = ($_ENV['APP_DEBUG_LEVEL'] ?: 'DEBUG');
23
-        if(!empty($channel)) {
23
+        if (!empty($channel)) {
24 24
             $this->channel = $channel;
25 25
             //TODO: get channel options
26 26
         } else {
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
      */
174 174
     private function formatMessage($message) {
175 175
 
176
-        if($message instanceof \Exception || $message instanceof Error) {
176
+        if ($message instanceof \Exception || $message instanceof Error) {
177 177
             $message = (string) $message;
178
-        } else if(is_array($message) || is_object($message)) {
178
+        } else if (is_array($message) || is_object($message)) {
179 179
             $message = json_encode((array) $message, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
180 180
             $message = str_replace('\\u0000', '', $message);
181 181
         }
@@ -187,15 +187,15 @@  discard block
 block discarded – undo
187 187
      */
188 188
     public function getLogger() {
189 189
 
190
-        if(Registry::hasLogger($this->channel)) {
190
+        if (Registry::hasLogger($this->channel)) {
191 191
             return Registry::getInstance($this->channel);
192 192
         }
193 193
         $logPath = $_SERVER['DOCUMENT_ROOT'] . ($_ENV['APP_LOG_FOLDER'] ?: '/log/');
194 194
         $logPath .= $this->channel . '/' . date('Y-m-d') . '.log';
195 195
         $logDir = pathinfo($logPath, PATHINFO_DIRNAME);
196
-        if(!file_exists($logDir)) {
196
+        if (!file_exists($logDir)) {
197 197
             $mode = 0775;
198
-            if(defined('BX_DIR_PERMISSIONS') && BX_DIR_PERMISSIONS) {
198
+            if (defined('BX_DIR_PERMISSIONS') && BX_DIR_PERMISSIONS) {
199 199
                 $mode = BX_DIR_PERMISSIONS;
200 200
             }
201 201
             mkdir($logDir, $mode, true);
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 
219 219
         $levels = Logger::getLevels();
220 220
 
221
-        if($this->minDebugLevel && isset($levels[$this->minDebugLevel])) {
221
+        if ($this->minDebugLevel && isset($levels[$this->minDebugLevel])) {
222 222
             return $levels[$this->minDebugLevel];
223 223
         } else {
224 224
             return Logger::DEBUG;
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
             return true;
236 236
         }
237 237
         $min_level = $this->getMinErrorLevel();
238
-        if($level >= $min_level) {
238
+        if ($level >= $min_level) {
239 239
             return true;
240 240
         }
241 241
         return false;
Please login to merge, or discard this patch.