Test Failed
Push — 1.0.0-dev ( 1b0350...9dccc6 )
by nguereza
02:25
created
core/classes/Config.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
             if ($init) {
47 47
                 $this->init();
48 48
                 //@codeCoverageIgnoreStart
49
-                 if (ENVIRONMENT == 'production' && in_array(strtolower($this->config['log_level']), array('debug', 'info', 'notice'))) {
49
+                    if (ENVIRONMENT == 'production' && in_array(strtolower($this->config['log_level']), array('debug', 'info', 'notice'))) {
50 50
                     $this->logger->warning('You are in production environment, please set '
51
-                                           . 'log level to WARNING, ERROR, CRITICAL, ALERT, EMERGENCY to increase the application performance');
51
+                                            . 'log level to WARNING, ERROR, CRITICAL, ALERT, EMERGENCY to increase the application performance');
52 52
                 }
53 53
                 //@codeCoverageIgnoreEnd
54 54
             }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
             if (empty($this->config['base_url'])) {
147 147
                 if (ENVIRONMENT == 'production') {
148 148
                     $this->logger->warning('Application base URL is not set or invalid, please'
149
-                                           . ' set application base URL to increase the application loading time');
149
+                                            . ' set application base URL to increase the application loading time');
150 150
                 }
151 151
                 $baseUrl = null;
152 152
                 $protocol = 'http';
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
                                                                     );
174 174
                 } else {
175 175
                     $this->logger->warning('Can not determine the application '
176
-                                           . 'base URL automatically, use http://localhost as default');
176
+                                            . 'base URL automatically, use http://localhost as default');
177 177
                     $baseUrl = 'http://localhost/';
178 178
                 }
179 179
                 $this->config['base_url'] = $baseUrl;
@@ -182,11 +182,11 @@  discard block
 block discarded – undo
182 182
         }
183 183
          
184 184
         /**
185
-        * Return the server port using variable
186
-        *
187
-        * @codeCoverageIgnore
188
-        * @return string
189
-        */
185
+         * Return the server port using variable
186
+         *
187
+         * @codeCoverageIgnore
188
+         * @return string
189
+         */
190 190
         protected function getServerPort() {
191 191
             $globals = & class_loader('GlobalVar', 'classes');
192 192
             $serverPort = $globals->server('SERVER_PORT');
Please login to merge, or discard this patch.
core/classes/Log.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -169,13 +169,13 @@  discard block
 block discarded – undo
169 169
             $this->log(self::DEBUG, $message);
170 170
         } 
171 171
 		
172
-	/**
173
-         * Logs with an arbitrary level.
174
-         *
175
-         * @param  integer|string $level   the log level in integer or string format,
176
-         * if is string will convert into integer. 
177
-         * @param  string $message the log message to be saved
178
-         */
172
+    /**
173
+     * Logs with an arbitrary level.
174
+     *
175
+     * @param  integer|string $level   the log level in integer or string format,
176
+     * if is string will convert into integer. 
177
+     * @param  string $message the log message to be saved
178
+     */
179 179
         public function log($level, $message) {
180 180
             $configLogLevel = get_config('log_level');
181 181
             if (!$configLogLevel) {
@@ -187,11 +187,11 @@  discard block
 block discarded – undo
187 187
                 //NOTE: here need put the show_error() "logging" to false 
188 188
                 //to prevent self function loop call
189 189
                 show_error('Invalid config log level [' . $configLogLevel . '], '
190
-                           . 'the value must be one of the following: ' 
191
-                           . implode(', ', array_map('strtoupper', self::$validConfigLevel))
192
-                           , 'Log Config Error', 
193
-                           $logging = false
194
-                       );
190
+                            . 'the value must be one of the following: ' 
191
+                            . implode(', ', array_map('strtoupper', self::$validConfigLevel))
192
+                            , 'Log Config Error', 
193
+                            $logging = false
194
+                        );
195 195
                 return;	
196 196
             }
197 197
 			
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
         protected function levelCanSaveLog($level) {
262 262
             $result = true;
263 263
             $configLogLevel = get_config('log_level');
264
-             //check if can save log regarding the log level configuration
264
+                //check if can save log regarding the log level configuration
265 265
             $configLevel = self::getLevelValue($configLogLevel);
266 266
             if ($configLevel > $level) {
267 267
                 //can't log
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
                 //NOTE: here need put the show_error() "logging" to false 
342 342
                 //to prevent self function loop call
343 343
                 show_error('Error : the log dir does not exist or is not writable',
344
-                           'Log directory error', $logging = false);
344
+                            'Log directory error', $logging = false);
345 345
             }
346 346
 			
347 347
             $path = $logSavePath . 'logs-' . date('Y-m-d') . '.log';
Please login to merge, or discard this patch.
core/classes/Response.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
                 $this->logger->info('Cannot find view [' . $view . '] in module [' . $module . '] '
186 186
                                     . 'using the default location');
187 187
             }
188
-	    if (!$path) {
188
+        if (!$path) {
189 189
                 $path = $this->getDefaultFilePathForView($viewFile);
190 190
             }
191 191
             $this->logger->info('The view file path to be loaded is [' . $path . ']');
@@ -261,12 +261,12 @@  discard block
 block discarded – undo
261 261
             return $this->finalPageContent;
262 262
         }
263 263
 
264
-         /**
265
-         * Set the final page to be rendered
266
-         * @param string $finalPage the content of the final page
267
-         * 
268
-         * @return object
269
-         */
264
+            /**
265
+             * Set the final page to be rendered
266
+             * @param string $finalPage the content of the final page
267
+             * 
268
+             * @return object
269
+             */
270 270
         public function setFinalPageContent($finalPage) {
271 271
             $this->finalPageContent = $finalPage;
272 272
             return $this;
@@ -340,11 +340,11 @@  discard block
 block discarded – undo
340 340
         }
341 341
 
342 342
                 /**
343
-         * Dispatch the FINAL_VIEW_READY event
344
-         *             
345
-         * @return string|null the final view content after processing by each listener
346
-         * if they exists otherwise the same content will be returned
347
-         */
343
+                 * Dispatch the FINAL_VIEW_READY event
344
+                 *             
345
+                 * @return string|null the final view content after processing by each listener
346
+                 * if they exists otherwise the same content will be returned
347
+                 */
348 348
         protected function dispatchFinalViewEvent() {
349 349
             //dispatch
350 350
             $event = get_instance()->eventdispatcher->dispatch(
@@ -388,12 +388,12 @@  discard block
 block discarded – undo
388 388
                                           && (bool) ini_get('zlib.output_compression') === false;
389 389
         }
390 390
 
391
-         /**
392
-         * Return the default full file path for view
393
-         * @param  string $file    the filename
394
-         * 
395
-         * @return string|null          the full file path
396
-         */
391
+            /**
392
+             * Return the default full file path for view
393
+             * @param  string $file    the filename
394
+             * 
395
+             * @return string|null          the full file path
396
+             */
397 397
         protected function getDefaultFilePathForView($file){
398 398
             $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH);
399 399
             $fullFilePath = null;
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
                 $headerModifiedSince = $globals->server('HTTP_IF_MODIFIED_SINCE');
427 427
                 if (!empty($headerModifiedSince) && $lastModified <= strtotime($headerModifiedSince)) {
428 428
                     $this->logger->info('The cache page content is not yet expire for the '
429
-                                         . 'URL [' . $this->currentUrl . '] send 304 header to browser');
429
+                                            . 'URL [' . $this->currentUrl . '] send 304 header to browser');
430 430
                     $this->sendHeaders(304);
431 431
                     return true;
432 432
                 }
@@ -441,8 +441,8 @@  discard block
 block discarded – undo
441 441
          */
442 442
         protected function sendCachePageContentToBrowser(&$cache) {
443 443
             $this->logger->info('The cache page content is expired or the browser does '
444
-                 . 'not send the HTTP_IF_MODIFIED_SINCE header for the URL [' . $this->currentUrl . '] '
445
-                 . 'send cache headers to tell the browser');
444
+                    . 'not send the HTTP_IF_MODIFIED_SINCE header for the URL [' . $this->currentUrl . '] '
445
+                    . 'send cache headers to tell the browser');
446 446
             $this->sendHeaders(200);
447 447
             //current page cache key
448 448
             $pageCacheKey = $this->currentUrlCacheKey;
@@ -581,18 +581,18 @@  discard block
 block discarded – undo
581 581
             }
582 582
         }
583 583
 
584
-         /**
585
-         * Set the mandory headers, like security, etc.
586
-         */
584
+            /**
585
+             * Set the mandory headers, like security, etc.
586
+             */
587 587
         protected function setRequiredHeaders() {
588 588
             $requiredHeaders = array(
589 589
                                 'X-XSS-Protection' => '1; mode=block',
590 590
                                 'X-Frame-Options'  => 'SAMEORIGIN'
591 591
                             );
592 592
             foreach ($requiredHeaders as $key => $value) {
593
-               if (!isset($this->headers[$key])) {
593
+                if (!isset($this->headers[$key])) {
594 594
                     $this->headers[$key] = $value;
595
-               } 
595
+                } 
596 596
             }
597 597
         }
598 598
     }
Please login to merge, or discard this patch.
core/classes/Router.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -276,14 +276,14 @@  discard block
 block discarded – undo
276 276
         }
277 277
 
278 278
         /**
279
-        * Setting the route configuration using the configuration file 
280
-        * and additional configuration from param
281
-        * @param array $overwriteConfig the additional configuration 
282
-        * to overwrite with the existing one
283
-        * @param boolean $useConfigFile whether to use route configuration file
284
-        * 
285
-        * @return object
286
-        */
279
+         * Setting the route configuration using the configuration file 
280
+         * and additional configuration from param
281
+         * @param array $overwriteConfig the additional configuration 
282
+         * to overwrite with the existing one
283
+         * @param boolean $useConfigFile whether to use route configuration file
284
+         * 
285
+         * @return object
286
+         */
287 287
         public function setRouteConfiguration(array $overwriteConfig = array(), $useConfigFile = true) {
288 288
             $route = array();
289 289
             if ($useConfigFile && file_exists(CONFIG_PATH . 'routes.php')) {
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
             //the URL like http://domain.com/module/controller/method/arg1/arg2/argn 
365 365
             if (!$this->controller) {
366 366
                 $this->logger->info('Cannot determine the routing information ' 
367
-                       . 'using the predefined routes configuration, will use the request URI parameters');
367
+                        . 'using the predefined routes configuration, will use the request URI parameters');
368 368
                 //determine route parameters using the route URI param
369 369
                 $this->determineRouteParamsFromRequestUri();
370 370
             }
@@ -478,11 +478,11 @@  discard block
 block discarded – undo
478 478
             }
479 479
         }
480 480
 
481
-         /**
482
-         * Remove the URL suffix and query string values if exists
483
-         * @param  string $uri the route URI to process
484
-         * @return string      the final route uri after processed
485
-         */
481
+            /**
482
+             * Remove the URL suffix and query string values if exists
483
+             * @param  string $uri the route URI to process
484
+             * @return string      the final route uri after processed
485
+             */
486 486
         protected function removeSuffixAndQueryStringFromUri($uri) {
487 487
             $this->logger->debug('Check if URL suffix is enabled in the configuration');
488 488
             //remove url suffix from the request URI
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
                 $this->logger->info(
599 599
                                     'After loop in predefined routes configuration,'
600 600
                                     . 'the module name is set but the controller is not set,' 
601
-									. 'so we will use module as the controller'
601
+                                    . 'so we will use module as the controller'
602 602
                                 );
603 603
                 $this->controller = $this->module;
604 604
             }
Please login to merge, or discard this patch.