Test Failed
Push — develop ( 2ed6fa...017eaa )
by nguereza
02:57
created
core/classes/Router.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
             $this->determineRouteParamsInformation();
395 395
 
396 396
             //if the request method not match
397
-            if(!$this->routeMethodMatch){
397
+            if (!$this->routeMethodMatch) {
398 398
                  //create the instance of Controller
399 399
                 $cError = new Controller();
400 400
                 $cError->response->setStatus(405);
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
          * Remove the DOCUMENT_ROOT and front controller from segments if exists
466 466
          * @return void
467 467
          */
468
-        protected function removeDocumentRootFrontControllerFromSegments(){
468
+        protected function removeDocumentRootFrontControllerFromSegments() {
469 469
             $segment = $this->segments;
470 470
             $globals = & class_loader('GlobalVar', 'classes');
471 471
             $rootFolder = substr($globals->server('SCRIPT_NAME'), 0, strpos(
@@ -519,11 +519,11 @@  discard block
 block discarded – undo
519 519
         protected function setRouteParamsUsingPredefinedConfig($findIndex) {
520 520
             $callback = $this->callback[$findIndex];
521 521
             //if callback is array so means user defined the HTTP Method
522
-            if(is_array($callback) && count($callback) > 0){
523
-                if(array_key_exists($this->requestMethod, $callback)){
522
+            if (is_array($callback) && count($callback) > 0) {
523
+                if (array_key_exists($this->requestMethod, $callback)) {
524 524
                     $callback = $callback[$this->requestMethod];
525 525
                 }
526
-                else{
526
+                else {
527 527
                     //Wrong request method
528 528
                     $this->logger->warning('The request method [' . $this->requestMethod . '] is not allowed');
529 529
                     $this->routeMethodMatch = false;
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
                     break;
610 610
                 }
611 611
             }
612
-            if($findIndex !== -1){
612
+            if ($findIndex !== -1) {
613 613
                 /*
614 614
                 * $args[0] => full string captured by preg_match
615 615
                 * $args[1], $args[2], $args[n] => contains the value of 
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
          * Find file path of the current controller using the current module
637 637
          * @return boolean true if the file path is found otherwise false.
638 638
          */
639
-        protected function findControllerFullPathUsingCurrentModule(){
639
+        protected function findControllerFullPathUsingCurrentModule() {
640 640
             $path = $this->moduleInstance->findControllerFullPath(ucfirst($this->controller), $this->module);
641 641
             if (!$path) {
642 642
                 $this->logger->info('The controller [' . $this->controller . '] not ' 
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
          * or the current request does not use module
654 654
          * @return void
655 655
          */
656
-        protected function setRouteParamsIfNoModuleOrNotFound(){
656
+        protected function setRouteParamsIfNoModuleOrNotFound() {
657 657
             $segment = $this->segments;
658 658
             //controller
659 659
             if (isset($segment[0])) {
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
          * or the current request use module
675 675
          * @return void
676 676
          */
677
-        protected function setRouteParamsIfAppHasModuleOrFound(){
677
+        protected function setRouteParamsIfAppHasModuleOrFound() {
678 678
             //get the module list
679 679
             $modules = $this->moduleInstance->getModuleList();
680 680
             $segment = $this->segments;
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
                 if (isset($segment[0])) {
687 687
                     $this->controller = $segment[0];
688 688
                     //check if the request use the same module name and controller
689
-                    if($this->findControllerFullPathUsingCurrentModule()){
689
+                    if ($this->findControllerFullPathUsingCurrentModule()) {
690 690
                         array_shift($segment);
691 691
                     }
692 692
                 }
Please login to merge, or discard this patch.