Test Failed
Push — 1.0.0-dev ( c48145...a13fd7 )
by nguereza
03:13
created
core/classes/cache/FileCache.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -108,13 +108,13 @@
 block discarded – undo
108 108
         public function set($key, $data, $ttl = 0) {
109 109
             $expire = time() + $ttl;
110 110
             $this->logger->debug('Setting cache data for key [' . $key . '], '
111
-                           . 'time to live [' . $ttl . '], '
112
-                           . 'expire at [' . date('Y-m-d H:i:s', $expire) . ']');
111
+                            . 'time to live [' . $ttl . '], '
112
+                            . 'expire at [' . date('Y-m-d H:i:s', $expire) . ']');
113 113
             $filePath = $this->getFilePath($key);
114 114
             $handle = fopen($filePath, 'w');
115 115
             if (!is_resource($handle)) {
116 116
                 $this->logger->error('Can not open the file cache '
117
-                                     . '[' . $filePath . '] for the key [' . $key . '], return false');
117
+                                        . '[' . $filePath . '] for the key [' . $key . '], return false');
118 118
                 return false;
119 119
             }
120 120
             flock($handle, LOCK_EX); // exclusive lock, will get released when the file is closed
Please login to merge, or discard this patch.
core/classes/Log.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -214,7 +214,7 @@
 block discarded – undo
214 214
         protected function getLogDebugBacktraceInfo() {
215 215
             $dtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
216 216
             $i = 0;
217
-            while ($dtrace[$i]['file'] == __FILE__ ) {
217
+            while ($dtrace[$i]['file'] == __FILE__) {
218 218
                 $i++;
219 219
             } 
220 220
             $fileInfo = $dtrace[$i];
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -140,11 +140,11 @@  discard block
 block discarded – undo
140 140
                 //NOTE: here need put the show_error() "logging" to false 
141 141
                 //to prevent self function loop call
142 142
                 show_error('Invalid config log level [' . $configLogLevel . '], '
143
-                           . 'the value must be one of the following: ' 
144
-                           . implode(', ', array_map('strtoupper', self::$validConfigLevel))
145
-                           , 'Log Config Error', 
146
-                           $logging = false
147
-                       );
143
+                            . 'the value must be one of the following: ' 
144
+                            . implode(', ', array_map('strtoupper', self::$validConfigLevel))
145
+                            , 'Log Config Error', 
146
+                            $logging = false
147
+                        );
148 148
                 return;	
149 149
             }
150 150
 			
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         protected function levelCanSaveLog($level) {
215 215
             $result = true;
216 216
             $configLogLevel = get_config('log_level');
217
-             //check if can save log regarding the log level configuration
217
+                //check if can save log regarding the log level configuration
218 218
             $configLevel = self::getLevelValue($configLogLevel);
219 219
             if ($configLevel > $level) {
220 220
                 //can't log
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
                 //NOTE: here need put the show_error() "logging" to false 
295 295
                 //to prevent self function loop call
296 296
                 show_error('Error : the log dir does not exist or is not writable',
297
-                           'Log directory error', $logging = false);
297
+                            'Log directory error', $logging = false);
298 298
             }
299 299
 			
300 300
             $path = $logSavePath . 'logs-' . date('Y-m-d') . '.log';
Please login to merge, or discard this patch.
app/config/config.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -178,20 +178,20 @@
 block discarded – undo
178 178
     $config['log_logger_name'] = array();
179 179
 
180 180
     /**
181
-    * The logger name custom level to use for the log
182
-    * 
183
-    * If this config is set so means the logger level will be used to overwrite 
184
-    * the default log level configuration above. 
185
-    *
186
-    * Example:
187
-    * $config['log_logger_name_level'] = array('MY_LOGGER1' => 'WARNING'); 
188
-    * So if $config['log_level'] = 'ERROR' but all log messages with "MY_LOGGER1" as logger name
189
-    *  will be saved for WARNING message and above
190
-    *  Note: You can also use an regular expression for the logger name.
191
-    *  Example:
192
-    *  $config['log_logger_name_level'] = array('^Class::Con(.*)' => 'info');
193
-    *  So all logger name like "Class::Config", "Class::Cookie", etc. will be match
194
-    */  
181
+     * The logger name custom level to use for the log
182
+     * 
183
+     * If this config is set so means the logger level will be used to overwrite 
184
+     * the default log level configuration above. 
185
+     *
186
+     * Example:
187
+     * $config['log_logger_name_level'] = array('MY_LOGGER1' => 'WARNING'); 
188
+     * So if $config['log_level'] = 'ERROR' but all log messages with "MY_LOGGER1" as logger name
189
+     *  will be saved for WARNING message and above
190
+     *  Note: You can also use an regular expression for the logger name.
191
+     *  Example:
192
+     *  $config['log_logger_name_level'] = array('^Class::Con(.*)' => 'info');
193
+     *  So all logger name like "Class::Config", "Class::Cookie", etc. will be match
194
+     */  
195 195
     $config['log_logger_name_level'] = array();
196 196
 	
197 197
 	
Please login to merge, or discard this patch.
core/classes/Router.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -277,14 +277,14 @@  discard block
 block discarded – undo
277 277
         }
278 278
 
279 279
         /**
280
-        * Setting the route configuration using the configuration file 
281
-        * and additional configuration from param
282
-        * @param array $overwriteConfig the additional configuration 
283
-        * to overwrite with the existing one
284
-        * @param boolean $useConfigFile whether to use route configuration file
285
-        * 
286
-        * @return object
287
-        */
280
+         * Setting the route configuration using the configuration file 
281
+         * and additional configuration from param
282
+         * @param array $overwriteConfig the additional configuration 
283
+         * to overwrite with the existing one
284
+         * @param boolean $useConfigFile whether to use route configuration file
285
+         * 
286
+         * @return object
287
+         */
288 288
         public function setRouteConfiguration(array $overwriteConfig = array(), $useConfigFile = true) {
289 289
             $route = array();
290 290
             if ($useConfigFile && file_exists(CONFIG_PATH . 'routes.php')) {
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
             //the URL like http://domain.com/module/controller/method/arg1/arg2
366 366
             if (!$this->controller) {
367 367
                 $this->logger->info('Cannot determine the routing information ' 
368
-                       . 'using the predefined routes configuration, will use the request URI parameters');
368
+                        . 'using the predefined routes configuration, will use the request URI parameters');
369 369
                 //determine route parameters using the route URI param
370 370
                 $this->determineRouteParamsFromRequestUri();
371 371
             }
@@ -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
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
                 $this->logger->info(
597 597
                                     'After loop in predefined routes configuration,'
598 598
                                     . 'the module name is set but the controller is not set,' 
599
-									. 'so we will use module as the controller'
599
+                                    . 'so we will use module as the controller'
600 600
                                 );
601 601
                 $this->controller = $this->module;
602 602
             }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
          * Remove the DOCUMENT_ROOT and front controller from segments if exists
451 451
          * @return void
452 452
          */
453
-        protected function removeDocumentRootFrontControllerFromSegments(){
453
+        protected function removeDocumentRootFrontControllerFromSegments() {
454 454
             $segment = $this->segments;
455 455
             $globals = & class_loader('GlobalVar', 'classes');
456 456
             $rootFolder = substr($globals->server('SCRIPT_NAME'), 0, strpos(
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
                     break;
582 582
                 }
583 583
             }
584
-            if($findIndex !== -1){
584
+            if ($findIndex !== -1) {
585 585
                 //$args[0] => full string captured by preg_match
586 586
                 //$args[1], $args[2], $args[n] => contains the value of 
587 587
                 //(:num), (:alpha), (:alnum), (:any)
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
          * Find file path of the current controller using the current module
607 607
          * @return boolean true if the file path is found otherwise false.
608 608
          */
609
-        protected function findControllerFullPathUsingCurrentModule(){
609
+        protected function findControllerFullPathUsingCurrentModule() {
610 610
             $path = $this->moduleInstance->findControllerFullPath(ucfirst($this->controller), $this->module);
611 611
             if (!$path) {
612 612
                 $this->logger->info('The controller [' . $this->controller . '] not ' 
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
          * or the current request does not use module
624 624
          * @return void
625 625
          */
626
-        protected function setRouteParamsIfNoModuleOrNotFound(){
626
+        protected function setRouteParamsIfNoModuleOrNotFound() {
627 627
             $segment = $this->segments;
628 628
             //controller
629 629
             if (isset($segment[0])) {
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
          * or the current request use module
645 645
          * @return void
646 646
          */
647
-        protected function setRouteParamsIfAppHasModuleOrFound(){
647
+        protected function setRouteParamsIfAppHasModuleOrFound() {
648 648
             //get the module list
649 649
             $modules = $this->moduleInstance->getModuleList();
650 650
             $segment = $this->segments;
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
                     $this->controller = $segment[0];
658 658
 
659 659
                     //check if the request use the same module name and controller
660
-                    if($this->findControllerFullPathUsingCurrentModule()){
660
+                    if ($this->findControllerFullPathUsingCurrentModule()) {
661 661
                         array_shift($segment);
662 662
                     }
663 663
                 }
Please login to merge, or discard this patch.