@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | } else { |
| 182 | 182 | $logger->info('Cannot find view [' . $view . '] in module [' . $module . '] using the default location'); |
| 183 | 183 | } |
| 184 | - if (!$path) { |
|
| 184 | + if (!$path) { |
|
| 185 | 185 | $path = $this->getDefaultFilePathForView($viewFile); |
| 186 | 186 | } |
| 187 | 187 | $logger->info('The view file path to be loaded is [' . $path . ']'); |
@@ -336,12 +336,12 @@ discard block |
||
| 336 | 336 | } |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | - /** |
|
| 340 | - * Return the default full file path for view |
|
| 341 | - * @param string $file the filename |
|
| 342 | - * |
|
| 343 | - * @return string|null the full file path |
|
| 344 | - */ |
|
| 339 | + /** |
|
| 340 | + * Return the default full file path for view |
|
| 341 | + * @param string $file the filename |
|
| 342 | + * |
|
| 343 | + * @return string|null the full file path |
|
| 344 | + */ |
|
| 345 | 345 | protected static function getDefaultFilePathForView($file){ |
| 346 | 346 | $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH); |
| 347 | 347 | $fullFilePath = null; |
@@ -530,18 +530,18 @@ discard block |
||
| 530 | 530 | } |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | - /** |
|
| 534 | - * Set the mandory headers, like security, etc. |
|
| 535 | - */ |
|
| 533 | + /** |
|
| 534 | + * Set the mandory headers, like security, etc. |
|
| 535 | + */ |
|
| 536 | 536 | protected static function setRequiredHeaders() { |
| 537 | 537 | $requiredHeaders = array( |
| 538 | 538 | 'X-XSS-Protection' => '1; mode=block', |
| 539 | 539 | 'X-Frame-Options' => 'SAMEORIGIN' |
| 540 | 540 | ); |
| 541 | 541 | foreach ($requiredHeaders as $key => $value) { |
| 542 | - if (!isset(self::$headers[$key])) { |
|
| 542 | + if (!isset(self::$headers[$key])) { |
|
| 543 | 543 | self::$headers[$key] = $value; |
| 544 | - } |
|
| 544 | + } |
|
| 545 | 545 | } |
| 546 | 546 | } |
| 547 | 547 | } |
@@ -342,7 +342,7 @@ |
||
| 342 | 342 | * |
| 343 | 343 | * @return string|null the full file path |
| 344 | 344 | */ |
| 345 | - protected static function getDefaultFilePathForView($file){ |
|
| 345 | + protected static function getDefaultFilePathForView($file) { |
|
| 346 | 346 | $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH); |
| 347 | 347 | $fullFilePath = null; |
| 348 | 348 | foreach ($searchDir as $dir) { |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | * Remove the DOCUMENT_ROOT and front controller from segments if exists |
| 410 | 410 | * @return void |
| 411 | 411 | */ |
| 412 | - protected function removeDocumentRootFrontControllerFromSegments(){ |
|
| 412 | + protected function removeDocumentRootFrontControllerFromSegments() { |
|
| 413 | 413 | $segment = $this->segments; |
| 414 | 414 | $baseUrl = get_config('base_url'); |
| 415 | 415 | //check if the app is not in DOCUMENT_ROOT |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | break; |
| 503 | 503 | } |
| 504 | 504 | } |
| 505 | - if($findIndex !== -1){ |
|
| 505 | + if ($findIndex !== -1) { |
|
| 506 | 506 | array_shift($args); |
| 507 | 507 | $this->setRouteParamsUsingPredefinedConfig($findIndex, $args); |
| 508 | 508 | } |
@@ -522,7 +522,7 @@ discard block |
||
| 522 | 522 | * Find file path of the current controller using the current module |
| 523 | 523 | * @return boolean true if the file path is found otherwise false. |
| 524 | 524 | */ |
| 525 | - protected function findControllerFullPathUsingCurrentModule(){ |
|
| 525 | + protected function findControllerFullPathUsingCurrentModule() { |
|
| 526 | 526 | $path = Module::findControllerFullPath(ucfirst($this->controller), $this->module); |
| 527 | 527 | if (!$path) { |
| 528 | 528 | $this->logger->info('The controller [' . $this->controller . '] not found in the module, may be will use the module [' . $this->module . '] as controller'); |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | * or the current request does not use module |
| 541 | 541 | * @return void |
| 542 | 542 | */ |
| 543 | - protected function setRouteParamsIfNoModuleOrNotFound(){ |
|
| 543 | + protected function setRouteParamsIfNoModuleOrNotFound() { |
|
| 544 | 544 | $segment = $this->segments; |
| 545 | 545 | //controller |
| 546 | 546 | if (isset($segment[0])) { |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | * or the current request use module |
| 562 | 562 | * @return void |
| 563 | 563 | */ |
| 564 | - protected function setRouteParamsIfAppHasModuleOrFound(){ |
|
| 564 | + protected function setRouteParamsIfAppHasModuleOrFound() { |
|
| 565 | 565 | //get the module list |
| 566 | 566 | $modules = Module::getModuleList(); |
| 567 | 567 | $segment = $this->segments; |
@@ -575,7 +575,7 @@ discard block |
||
| 575 | 575 | $this->controller = $segment[0]; |
| 576 | 576 | |
| 577 | 577 | //check if the request use the same module name and controller |
| 578 | - if($this->findControllerFullPathUsingCurrentModule()){ |
|
| 578 | + if ($this->findControllerFullPathUsingCurrentModule()) { |
|
| 579 | 579 | array_shift($segment); |
| 580 | 580 | } |
| 581 | 581 | } |
@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | public function add($name) { |
| 67 | 67 | $logger = self::getLogger(); |
| 68 | 68 | if (in_array($name, self::$list)) { |
| 69 | - $logger->info('The module [' .$name. '] already added skipping.'); |
|
| 70 | - return $this; |
|
| 69 | + $logger->info('The module [' .$name. '] already added skipping.'); |
|
| 70 | + return $this; |
|
| 71 | 71 | } |
| 72 | 72 | self::$list[] = $name; |
| 73 | 73 | return $this; |
@@ -97,10 +97,10 @@ discard block |
||
| 97 | 97 | self::$list = array(); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - /** |
|
| 101 | - * Get the list of module loaded |
|
| 102 | - * @return array the module list |
|
| 103 | - */ |
|
| 100 | + /** |
|
| 101 | + * Get the list of module loaded |
|
| 102 | + * @return array the module list |
|
| 103 | + */ |
|
| 104 | 104 | public static function getModuleList() { |
| 105 | 105 | return self::$list; |
| 106 | 106 | } |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | public function add($name) { |
| 67 | 67 | $logger = self::getLogger(); |
| 68 | 68 | if (in_array($name, self::$list)) { |
| 69 | - $logger->info('The module [' .$name. '] already added skipping.'); |
|
| 69 | + $logger->info('The module [' . $name . '] already added skipping.'); |
|
| 70 | 70 | return $this; |
| 71 | 71 | } |
| 72 | 72 | self::$list[] = $name; |