Test Failed
Push — develop ( 2ed6fa...017eaa )
by nguereza
02:57
created
core/bootstrap.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,32 +1,32 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
     defined('ROOT_PATH') || exit('Access denied');
3
-     /**
4
-     * TNH Framework
5
-     *
6
-     * A simple PHP framework using HMVC architecture
7
-     *
8
-     * This content is released under the MIT License (MIT)
9
-     *
10
-     * Copyright (c) 2017 TNH Framework
11
-     *
12
-     * Permission is hereby granted, free of charge, to any person obtaining a copy
13
-     * of this software and associated documentation files (the "Software"), to deal
14
-     * in the Software without restriction, including without limitation the rights
15
-     * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
-     * copies of the Software, and to permit persons to whom the Software is
17
-     * furnished to do so, subject to the following conditions:
18
-     *
19
-     * The above copyright notice and this permission notice shall be included in all
20
-     * copies or substantial portions of the Software.
21
-     *
22
-     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
-     * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
-     * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
-     * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
-     * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
-     * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
-     * SOFTWARE.
29
-     */
3
+        /**
4
+         * TNH Framework
5
+         *
6
+         * A simple PHP framework using HMVC architecture
7
+         *
8
+         * This content is released under the MIT License (MIT)
9
+         *
10
+         * Copyright (c) 2017 TNH Framework
11
+         *
12
+         * Permission is hereby granted, free of charge, to any person obtaining a copy
13
+         * of this software and associated documentation files (the "Software"), to deal
14
+         * in the Software without restriction, including without limitation the rights
15
+         * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+         * copies of the Software, and to permit persons to whom the Software is
17
+         * furnished to do so, subject to the following conditions:
18
+         *
19
+         * The above copyright notice and this permission notice shall be included in all
20
+         * copies or substantial portions of the Software.
21
+         *
22
+         * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+         * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+         * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+         * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+         * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+         * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+         * SOFTWARE.
29
+         */
30 30
 
31 31
     /**
32 32
      *  @file bootstrap.php
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
                     . '] please install a PHP version that is compatible.', 'PHP Error environment');	
94 94
     }
95 95
     $LOGGER->info('PHP version [' . phpversion() . '] is OK [REQUIRED MINIMUM: ' . TNH_MIN_PHP_VERSION 
96
-                   . ', REQUIRED MAXIMUM: ' . TNH_MAX_PHP_VERSION . '] application can work without any issue');
96
+                    . ', REQUIRED MAXIMUM: ' . TNH_MAX_PHP_VERSION . '] application can work without any issue');
97 97
 
98 98
     /**
99 99
      * Setting of the PHP error message handling function
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     /**
156 156
      * Register controllers autoload function
157 157
      */
158
-     spl_autoload_register('autoload_controller');
158
+        spl_autoload_register('autoload_controller');
159 159
 
160 160
     /**
161 161
      * Loading Security class
Please login to merge, or discard this patch.
core/classes/Response.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
                 $this->logger->info('Cannot find view [' . $view . '] in module [' . $module . '] '
211 211
                                     . 'using the default location');
212 212
             }
213
-	    if (!$path) {
213
+        if (!$path) {
214 214
                 $path = $this->getDefaultFilePathForView($viewFile);
215 215
             }
216 216
             $this->logger->info('The view file path to be loaded is [' . $path . ']');
@@ -286,12 +286,12 @@  discard block
 block discarded – undo
286 286
             return $this->finalPageContent;
287 287
         }
288 288
 
289
-         /**
290
-         * Set the final page to be rendered
291
-         * @param string $finalPage the content of the final page
292
-         * 
293
-         * @return object
294
-         */
289
+            /**
290
+             * Set the final page to be rendered
291
+             * @param string $finalPage the content of the final page
292
+             * 
293
+             * @return object
294
+             */
295 295
         public function setFinalPageContent($finalPage) {
296 296
             $this->finalPageContent = $finalPage;
297 297
             return $this;
@@ -366,12 +366,12 @@  discard block
 block discarded – undo
366 366
             //@codeCoverageIgnoreEnd
367 367
         }
368 368
 
369
-         /**
370
-         * Dispatch the FINAL_VIEW_READY event
371
-         *             
372
-         * @return string|null the final view content after processing by each listener
373
-         * if they exists otherwise the same content will be returned
374
-         */
369
+            /**
370
+             * Dispatch the FINAL_VIEW_READY event
371
+             *             
372
+             * @return string|null the final view content after processing by each listener
373
+             * if they exists otherwise the same content will be returned
374
+             */
375 375
         protected function dispatchFinalViewEvent() {
376 376
             //dispatch
377 377
             $event = get_instance()->eventdispatcher->dispatch(
@@ -415,12 +415,12 @@  discard block
 block discarded – undo
415 415
                                           && (bool) ini_get('zlib.output_compression') === false;
416 416
         }
417 417
 
418
-         /**
419
-         * Return the default full file path for view
420
-         * @param  string $file    the filename
421
-         * 
422
-         * @return string|null          the full file path
423
-         */
418
+            /**
419
+             * Return the default full file path for view
420
+             * @param  string $file    the filename
421
+             * 
422
+             * @return string|null          the full file path
423
+             */
424 424
         protected function getDefaultFilePathForView($file){
425 425
             $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH);
426 426
             $fullFilePath = null;
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
                 $headerModifiedSince = $globals->server('HTTP_IF_MODIFIED_SINCE');
454 454
                 if (!empty($headerModifiedSince) && $lastModified <= strtotime($headerModifiedSince)) {
455 455
                     $this->logger->info('The cache page content is not yet expire for the '
456
-                                         . 'URL [' . $this->currentUrl . '] send 304 header to browser');
456
+                                            . 'URL [' . $this->currentUrl . '] send 304 header to browser');
457 457
                     $this->setStatus(304);
458 458
                     $this->sendHeaders();
459 459
                     return true;
@@ -469,8 +469,8 @@  discard block
 block discarded – undo
469 469
          */
470 470
         protected function sendCachePageContentToBrowser(&$cache) {
471 471
             $this->logger->info('The cache page content is expired or the browser does '
472
-                 . 'not send the HTTP_IF_MODIFIED_SINCE header for the URL [' . $this->currentUrl . '] '
473
-                 . 'send cache headers to tell the browser');
472
+                    . 'not send the HTTP_IF_MODIFIED_SINCE header for the URL [' . $this->currentUrl . '] '
473
+                    . 'send cache headers to tell the browser');
474 474
             $this->sendHeaders();
475 475
             //current page cache key
476 476
             $pageCacheKey = $this->currentUrlCacheKey;
@@ -609,18 +609,18 @@  discard block
 block discarded – undo
609 609
             }
610 610
         }
611 611
 
612
-         /**
613
-         * Set the mandory headers, like security, etc.
614
-         */
612
+            /**
613
+             * Set the mandory headers, like security, etc.
614
+             */
615 615
         protected function setRequiredHeaders() {
616 616
             $requiredHeaders = array(
617 617
                                 'X-XSS-Protection' => '1; mode=block',
618 618
                                 'X-Frame-Options'  => 'SAMEORIGIN'
619 619
                             );
620 620
             foreach ($requiredHeaders as $key => $value) {
621
-               if (!isset($this->headers[$key])) {
621
+                if (!isset($this->headers[$key])) {
622 622
                     $this->headers[$key] = $value;
623
-               } 
623
+                } 
624 624
             }
625 625
         }
626 626
     }
Please login to merge, or discard this patch.
core/classes/EventDispatcher.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@
 block discarded – undo
156 156
                 return;
157 157
             } 
158 158
             $this->logger->info('Found the registered event listener for the '
159
-                                 . 'event [' . $event->getName() . '] the list are: ' . stringify_vars($list));
159
+                                    . 'event [' . $event->getName() . '] the list are: ' . stringify_vars($list));
160 160
             foreach ($list as $listener) {
161 161
                 $result = call_user_func_array($listener, array($event));
162 162
                 if ($event->isReturnBack() === true) {
Please login to merge, or discard this patch.
core/classes/Router.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -278,14 +278,14 @@  discard block
 block discarded – undo
278 278
         }
279 279
 
280 280
         /**
281
-        * Setting the route configuration using the configuration file 
282
-        * and additional configuration from param
283
-        * @param array $overwriteConfig the additional configuration 
284
-        * to overwrite with the existing one
285
-        * @param boolean $useConfigFile whether to use route configuration file
286
-        * 
287
-        * @return object
288
-        */
281
+         * Setting the route configuration using the configuration file 
282
+         * and additional configuration from param
283
+         * @param array $overwriteConfig the additional configuration 
284
+         * to overwrite with the existing one
285
+         * @param boolean $useConfigFile whether to use route configuration file
286
+         * 
287
+         * @return object
288
+         */
289 289
         public function setRouteConfiguration(array $overwriteConfig = array(), $useConfigFile = true) {
290 290
             $route = array();
291 291
             if ($useConfigFile && file_exists(CONFIG_PATH . 'routes.php')) {
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
             //the URL like http://domain.com/module/controller/method/arg1/arg2/argn 
367 367
             if (!$this->controller && $this->routeMethodMatch /* normally if the route method isnot match no need continue */) {
368 368
                 $this->logger->info('Cannot determine the routing information ' 
369
-                       . 'using the predefined routes configuration, will use the request URI parameters');
369
+                        . 'using the predefined routes configuration, will use the request URI parameters');
370 370
                 //determine route parameters using the route URI param
371 371
                 $this->determineRouteParamsFromRequestUri();
372 372
             }
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 
396 396
             //if the request method not match
397 397
             if(!$this->routeMethodMatch){
398
-                 //create the instance of Controller
398
+                    //create the instance of Controller
399 399
                 $cError = new Controller();
400 400
                 $cError->response->setStatus(405);
401 401
                 $cError->response->setFinalPageContent('HTTP method [' . $this->requestMethod . '] not allowed');
@@ -493,11 +493,11 @@  discard block
 block discarded – undo
493 493
             }
494 494
         }
495 495
 
496
-         /**
497
-         * Remove the URL suffix and query string values if exists
498
-         * @param  string $uri the route URI to process
499
-         * @return string      the final route uri after processed
500
-         */
496
+            /**
497
+             * Remove the URL suffix and query string values if exists
498
+             * @param  string $uri the route URI to process
499
+             * @return string      the final route uri after processed
500
+             */
501 501
         protected function removeSuffixAndQueryStringFromUri($uri) {
502 502
             $this->logger->debug('Check if URL suffix is enabled in the configuration');
503 503
             //remove url suffix from the request URI
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
                 $this->logger->info(
627 627
                                     'After loop in predefined routes configuration,'
628 628
                                     . 'the module name is set but the controller is not set,' 
629
-									. 'so we will use module as the controller'
629
+                                    . 'so we will use module as the controller'
630 630
                                 );
631 631
                 $this->controller = $this->module;
632 632
             }
Please login to merge, or discard this patch.