@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | } else { |
186 | 186 | $logger->info('Cannot find view [' . $view . '] in module [' . $module . '] using the default location'); |
187 | 187 | } |
188 | - if (!$path) { |
|
188 | + if (!$path) { |
|
189 | 189 | $path = $this->getDefaultFilePathForView($viewFile); |
190 | 190 | } |
191 | 191 | $logger->info('The view file path to be loaded is [' . $path . ']'); |
@@ -273,12 +273,12 @@ discard block |
||
273 | 273 | return $this->_pageRender; |
274 | 274 | } |
275 | 275 | |
276 | - /** |
|
277 | - * Set the final page to be rendered |
|
278 | - * @param string $finalPage the content of the final page |
|
279 | - * |
|
280 | - * @return object |
|
281 | - */ |
|
276 | + /** |
|
277 | + * Set the final page to be rendered |
|
278 | + * @param string $finalPage the content of the final page |
|
279 | + * |
|
280 | + * @return object |
|
281 | + */ |
|
282 | 282 | public function setFinalPageContent($finalPage) { |
283 | 283 | $this->_pageRender = $finalPage; |
284 | 284 | return $this; |
@@ -351,12 +351,12 @@ discard block |
||
351 | 351 | ob_end_flush(); |
352 | 352 | } |
353 | 353 | |
354 | - /** |
|
355 | - * Return the default full file path for view |
|
356 | - * @param string $file the filename |
|
357 | - * |
|
358 | - * @return string|null the full file path |
|
359 | - */ |
|
354 | + /** |
|
355 | + * Return the default full file path for view |
|
356 | + * @param string $file the filename |
|
357 | + * |
|
358 | + * @return string|null the full file path |
|
359 | + */ |
|
360 | 360 | protected static function getDefaultFilePathForView($file){ |
361 | 361 | $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH); |
362 | 362 | $fullFilePath = null; |
@@ -548,18 +548,18 @@ discard block |
||
548 | 548 | } |
549 | 549 | } |
550 | 550 | |
551 | - /** |
|
552 | - * Set the mandory headers, like security, etc. |
|
553 | - */ |
|
551 | + /** |
|
552 | + * Set the mandory headers, like security, etc. |
|
553 | + */ |
|
554 | 554 | protected static function setRequiredHeaders() { |
555 | 555 | $requiredHeaders = array( |
556 | 556 | 'X-XSS-Protection' => '1; mode=block', |
557 | 557 | 'X-Frame-Options' => 'SAMEORIGIN' |
558 | 558 | ); |
559 | 559 | foreach ($requiredHeaders as $key => $value) { |
560 | - if (!isset(self::$headers[$key])) { |
|
560 | + if (!isset(self::$headers[$key])) { |
|
561 | 561 | self::$headers[$key] = $value; |
562 | - } |
|
562 | + } |
|
563 | 563 | } |
564 | 564 | } |
565 | 565 | } |
@@ -241,12 +241,12 @@ discard block |
||
241 | 241 | } |
242 | 242 | |
243 | 243 | /** |
244 | - * Setting the route configuration using the configuration file and additional configuration from param |
|
245 | - * @param array $overwriteConfig the additional configuration to overwrite with the existing one |
|
246 | - * @param boolean $useConfigFile whether to use route configuration file |
|
247 | - * |
|
248 | - * @return object |
|
249 | - */ |
|
244 | + * Setting the route configuration using the configuration file and additional configuration from param |
|
245 | + * @param array $overwriteConfig the additional configuration to overwrite with the existing one |
|
246 | + * @param boolean $useConfigFile whether to use route configuration file |
|
247 | + * |
|
248 | + * @return object |
|
249 | + */ |
|
250 | 250 | public function setRouteConfiguration(array $overwriteConfig = array(), $useConfigFile = true) { |
251 | 251 | $route = array(); |
252 | 252 | if ($useConfigFile && file_exists(CONFIG_PATH . 'routes.php')) { |
@@ -423,11 +423,11 @@ discard block |
||
423 | 423 | } |
424 | 424 | } |
425 | 425 | |
426 | - /** |
|
427 | - * Remove the URL suffix and query string values if exists |
|
428 | - * @param string $uri the route URI to process |
|
429 | - * @return string the final route uri after processed |
|
430 | - */ |
|
426 | + /** |
|
427 | + * Remove the URL suffix and query string values if exists |
|
428 | + * @param string $uri the route URI to process |
|
429 | + * @return string the final route uri after processed |
|
430 | + */ |
|
431 | 431 | protected function removeSuffixAndQueryStringFromUri($uri) { |
432 | 432 | $this->logger->debug('Check if URL suffix is enabled in the configuration'); |
433 | 433 | //remove url suffix from the request URI |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | $this->logger->info( |
541 | 541 | 'After loop in predefined routes configuration,' |
542 | 542 | . 'the module name is set but the controller is not set,' |
543 | - . 'so we will use module as the controller' |
|
543 | + . 'so we will use module as the controller' |
|
544 | 544 | ); |
545 | 545 | $this->controller = $this->module; |
546 | 546 | } |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | * Remove the DOCUMENT_ROOT and front controller from segments if exists |
408 | 408 | * @return void |
409 | 409 | */ |
410 | - protected function removeDocumentRootFrontControllerFromSegments(){ |
|
410 | + protected function removeDocumentRootFrontControllerFromSegments() { |
|
411 | 411 | $segment = $this->segments; |
412 | 412 | $baseUrl = get_config('base_url'); |
413 | 413 | //check if the app is not in DOCUMENT_ROOT |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | break; |
526 | 526 | } |
527 | 527 | } |
528 | - if($findIndex !== -1){ |
|
528 | + if ($findIndex !== -1) { |
|
529 | 529 | //$args[0] => full string captured by preg_match |
530 | 530 | //$args[1], $args[2], $args[n] => contains the value of |
531 | 531 | //(:num), (:alpha), (:alnum), (:any) |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | * Find file path of the current controller using the current module |
551 | 551 | * @return boolean true if the file path is found otherwise false. |
552 | 552 | */ |
553 | - protected function findControllerFullPathUsingCurrentModule(){ |
|
553 | + protected function findControllerFullPathUsingCurrentModule() { |
|
554 | 554 | $path = Module::findControllerFullPath(ucfirst($this->controller), $this->module); |
555 | 555 | if (!$path) { |
556 | 556 | $this->logger->info('The controller [' . $this->controller . '] not found in the module, may be will use the module [' . $this->module . '] as controller'); |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | * or the current request does not use module |
567 | 567 | * @return void |
568 | 568 | */ |
569 | - protected function setRouteParamsIfNoModuleOrNotFound(){ |
|
569 | + protected function setRouteParamsIfNoModuleOrNotFound() { |
|
570 | 570 | $segment = $this->segments; |
571 | 571 | //controller |
572 | 572 | if (isset($segment[0])) { |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | * or the current request use module |
588 | 588 | * @return void |
589 | 589 | */ |
590 | - protected function setRouteParamsIfAppHasModuleOrFound(){ |
|
590 | + protected function setRouteParamsIfAppHasModuleOrFound() { |
|
591 | 591 | //get the module list |
592 | 592 | $modules = Module::getModuleList(); |
593 | 593 | $segment = $this->segments; |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | $this->controller = $segment[0]; |
601 | 601 | |
602 | 602 | //check if the request use the same module name and controller |
603 | - if($this->findControllerFullPathUsingCurrentModule()){ |
|
603 | + if ($this->findControllerFullPathUsingCurrentModule()) { |
|
604 | 604 | array_shift($segment); |
605 | 605 | } |
606 | 606 | } |