@@ -394,7 +394,7 @@ discard block |
||
| 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 |
||
| 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( |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | //Remove "/" at the first or folder root |
| 476 | 476 | $rootFolder = trim($rootFolder, $this->uriTrim); |
| 477 | 477 | $segmentString = implode('/', $segment); |
| 478 | - if(preg_match('#^' . $rootFolder .'#', $segmentString)){ |
|
| 478 | + if (preg_match('#^' . $rootFolder . '#', $segmentString)) { |
|
| 479 | 479 | $segmentString = substr($segmentString, strlen($rootFolder)); |
| 480 | 480 | } |
| 481 | 481 | //Remove the "/" after replace like "root_folder/foo" => "/foo" |
@@ -521,11 +521,11 @@ discard block |
||
| 521 | 521 | protected function setRouteParamsUsingPredefinedConfig($findIndex) { |
| 522 | 522 | $callback = $this->callback[$findIndex]; |
| 523 | 523 | //if callback is array so means user defined the HTTP Method |
| 524 | - if(is_array($callback) && count($callback) > 0){ |
|
| 525 | - if(array_key_exists($this->requestMethod, $callback)){ |
|
| 524 | + if (is_array($callback) && count($callback) > 0) { |
|
| 525 | + if (array_key_exists($this->requestMethod, $callback)) { |
|
| 526 | 526 | $callback = $callback[$this->requestMethod]; |
| 527 | 527 | } |
| 528 | - else{ |
|
| 528 | + else { |
|
| 529 | 529 | //Wrong request method |
| 530 | 530 | $this->logger->warning('The request method [' . $this->requestMethod . '] is not allowed'); |
| 531 | 531 | $this->routeMethodMatch = false; |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | break; |
| 612 | 612 | } |
| 613 | 613 | } |
| 614 | - if($findIndex !== -1){ |
|
| 614 | + if ($findIndex !== -1) { |
|
| 615 | 615 | /* |
| 616 | 616 | * $args[0] => full string captured by preg_match |
| 617 | 617 | * $args[1], $args[2], $args[n] => contains the value of |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | * Find file path of the current controller using the current module |
| 639 | 639 | * @return boolean true if the file path is found otherwise false. |
| 640 | 640 | */ |
| 641 | - protected function findControllerFullPathUsingCurrentModule(){ |
|
| 641 | + protected function findControllerFullPathUsingCurrentModule() { |
|
| 642 | 642 | $path = $this->moduleInstance->findControllerFullPath(ucfirst($this->controller), $this->module); |
| 643 | 643 | if (!$path) { |
| 644 | 644 | $this->logger->info('The controller [' . $this->controller . '] not ' |
@@ -655,7 +655,7 @@ discard block |
||
| 655 | 655 | * or the current request does not use module |
| 656 | 656 | * @return void |
| 657 | 657 | */ |
| 658 | - protected function setRouteParamsIfNoModuleOrNotFound(){ |
|
| 658 | + protected function setRouteParamsIfNoModuleOrNotFound() { |
|
| 659 | 659 | $segment = $this->segments; |
| 660 | 660 | //controller |
| 661 | 661 | if (isset($segment[0])) { |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | * or the current request use module |
| 677 | 677 | * @return void |
| 678 | 678 | */ |
| 679 | - protected function setRouteParamsIfAppHasModuleOrFound(){ |
|
| 679 | + protected function setRouteParamsIfAppHasModuleOrFound() { |
|
| 680 | 680 | //get the module list |
| 681 | 681 | $modules = $this->moduleInstance->getModuleList(); |
| 682 | 682 | $segment = $this->segments; |
@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | if (isset($segment[0])) { |
| 689 | 689 | $this->controller = $segment[0]; |
| 690 | 690 | //check if the request use the same module name and controller |
| 691 | - if($this->findControllerFullPathUsingCurrentModule()){ |
|
| 691 | + if ($this->findControllerFullPathUsingCurrentModule()) { |
|
| 692 | 692 | array_shift($segment); |
| 693 | 693 | } |
| 694 | 694 | } |
@@ -403,10 +403,10 @@ discard block |
||
| 403 | 403 | * @return object the current instance |
| 404 | 404 | */ |
| 405 | 405 | protected function filterValidationData() { |
| 406 | - foreach ($this->data as $key => $value ) { |
|
| 406 | + foreach ($this->data as $key => $value) { |
|
| 407 | 407 | if (is_string($value)) { |
| 408 | 408 | $this->data[$key] = trim($value); |
| 409 | - } else if(is_array($value)) { |
|
| 409 | + } else if (is_array($value)) { |
|
| 410 | 410 | $this->data[$key] = array_map('trim', $value); |
| 411 | 411 | } |
| 412 | 412 | } |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | '{paramValue}' => $paramValue |
| 450 | 450 | ); |
| 451 | 451 | if ($field2 !== null) { |
| 452 | - $template['{field2}'] = $field2; |
|
| 452 | + $template['{field2}'] = $field2; |
|
| 453 | 453 | $template['{value2}'] = $this->getFieldValue($field2); |
| 454 | 454 | $template['{label2}'] = $this->getFieldLabel($field2); |
| 455 | 455 | } |
@@ -1136,7 +1136,7 @@ discard block |
||
| 1136 | 1136 | $rule, |
| 1137 | 1137 | $paramValue |
| 1138 | 1138 | ); |
| 1139 | - } else{ |
|
| 1139 | + } else { |
|
| 1140 | 1140 | $this->forceError = true; |
| 1141 | 1141 | show_error('The callback validation function/method "' . $paramValue . '" does not exist'); |
| 1142 | 1142 | } |