@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $this->logger->debug('Check if the application contains the modules ...'); |
| 47 | 47 | $dirList = glob(MODULE_PATH . '*', GLOB_ONLYDIR); |
| 48 | 48 | if ($dirList !== false) { |
| 49 | - $this->list = array_map('basename', $dirList); |
|
| 49 | + $this->list = array_map('basename', $dirList); |
|
| 50 | 50 | } |
| 51 | 51 | if (!empty($this->list)) { |
| 52 | 52 | $this->logger->info('The application contains the module below [' . implode(', ', $this->list) . ']'); |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function add($name) { |
| 63 | 63 | if (in_array($name, $this->list)) { |
| 64 | - $this->logger->info('The module [' .$name. '] already added skipping.'); |
|
| 65 | - return $this; |
|
| 64 | + $this->logger->info('The module [' .$name. '] already added skipping.'); |
|
| 65 | + return $this; |
|
| 66 | 66 | } |
| 67 | 67 | $this->list[] = $name; |
| 68 | 68 | return $this; |
@@ -93,10 +93,10 @@ discard block |
||
| 93 | 93 | $this->list = array(); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - /** |
|
| 97 | - * Get the list of module loaded |
|
| 98 | - * @return array the module list |
|
| 99 | - */ |
|
| 96 | + /** |
|
| 97 | + * Get the list of module loaded |
|
| 98 | + * @return array the module list |
|
| 99 | + */ |
|
| 100 | 100 | public function getModuleList() { |
| 101 | 101 | return $this->list; |
| 102 | 102 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | */ |
| 62 | 62 | public function add($name) { |
| 63 | 63 | if (in_array($name, $this->list)) { |
| 64 | - $this->logger->info('The module [' .$name. '] already added skipping.'); |
|
| 64 | + $this->logger->info('The module [' . $name . '] already added skipping.'); |
|
| 65 | 65 | return $this; |
| 66 | 66 | } |
| 67 | 67 | $this->list[] = $name; |
@@ -680,22 +680,22 @@ discard block |
||
| 680 | 680 | return $data; |
| 681 | 681 | } |
| 682 | 682 | |
| 683 | - /** |
|
| 684 | - * Get the return type array or object |
|
| 685 | - * @return string|boolean |
|
| 686 | - */ |
|
| 683 | + /** |
|
| 684 | + * Get the return type array or object |
|
| 685 | + * @return string|boolean |
|
| 686 | + */ |
|
| 687 | 687 | protected function getReturnType(){ |
| 688 | 688 | $type = false; |
| 689 | 689 | if ($this->_temporary_return_type == 'array') { |
| 690 | - $type = 'array'; |
|
| 690 | + $type = 'array'; |
|
| 691 | 691 | } |
| 692 | 692 | return $type; |
| 693 | 693 | } |
| 694 | 694 | |
| 695 | - /** |
|
| 696 | - * Check if soft delete is enable setting the condition |
|
| 697 | - * @return object the current instance |
|
| 698 | - */ |
|
| 695 | + /** |
|
| 696 | + * Check if soft delete is enable setting the condition |
|
| 697 | + * @return object the current instance |
|
| 698 | + */ |
|
| 699 | 699 | protected function checkForSoftDelete(){ |
| 700 | 700 | if ($this->soft_delete && $this->_temporary_with_deleted !== true) { |
| 701 | 701 | $this->getQueryBuilder()->where($this->soft_delete_key, (bool) $this->_temporary_only_deleted); |
@@ -703,14 +703,14 @@ discard block |
||
| 703 | 703 | return $this; |
| 704 | 704 | } |
| 705 | 705 | |
| 706 | - /** |
|
| 707 | - * Relate for "belongs_to" and "has_many" |
|
| 708 | - * @param string $relationship the name of relation |
|
| 709 | - * @param string|array $options the model and primary key values |
|
| 710 | - * @param object|array $row the row to update |
|
| 711 | - * @param string $type the type can be "belongs_to", "has_many" |
|
| 712 | - * @return mixed the final row values |
|
| 713 | - */ |
|
| 706 | + /** |
|
| 707 | + * Relate for "belongs_to" and "has_many" |
|
| 708 | + * @param string $relationship the name of relation |
|
| 709 | + * @param string|array $options the model and primary key values |
|
| 710 | + * @param object|array $row the row to update |
|
| 711 | + * @param string $type the type can be "belongs_to", "has_many" |
|
| 712 | + * @return mixed the final row values |
|
| 713 | + */ |
|
| 714 | 714 | protected function relateBelongsToAndHasMany($relationship, $options, $row, $type){ |
| 715 | 715 | if (in_array($relationship, $this->_with)) { |
| 716 | 716 | get_instance()->loader->model($options['model'], $relationship . '_model'); |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $instance = $db; |
| 144 | 144 | } else { |
| 145 | 145 | $obj = & get_instance(); |
| 146 | - if (isset($obj->database)){ |
|
| 146 | + if (isset($obj->database)) { |
|
| 147 | 147 | /** |
| 148 | 148 | * NOTE: Need use "clone" because some Model need have the personal instance of the database library |
| 149 | 149 | * to prevent duplication |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | * Get the return type array or object |
| 685 | 685 | * @return string|boolean |
| 686 | 686 | */ |
| 687 | - protected function getReturnType(){ |
|
| 687 | + protected function getReturnType() { |
|
| 688 | 688 | $type = false; |
| 689 | 689 | if ($this->_temporary_return_type == 'array') { |
| 690 | 690 | $type = 'array'; |
@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | * Check if soft delete is enable setting the condition |
| 697 | 697 | * @return object the current instance |
| 698 | 698 | */ |
| 699 | - protected function checkForSoftDelete(){ |
|
| 699 | + protected function checkForSoftDelete() { |
|
| 700 | 700 | if ($this->soft_delete && $this->_temporary_with_deleted !== true) { |
| 701 | 701 | $this->getQueryBuilder()->where($this->soft_delete_key, (bool) $this->_temporary_only_deleted); |
| 702 | 702 | } |
@@ -711,11 +711,11 @@ discard block |
||
| 711 | 711 | * @param string $type the type can be "belongs_to", "has_many" |
| 712 | 712 | * @return mixed the final row values |
| 713 | 713 | */ |
| 714 | - protected function relateBelongsToAndHasMany($relationship, $options, $row, $type){ |
|
| 714 | + protected function relateBelongsToAndHasMany($relationship, $options, $row, $type) { |
|
| 715 | 715 | if (in_array($relationship, $this->_with)) { |
| 716 | 716 | get_instance()->loader->model($options['model'], $relationship . '_model'); |
| 717 | 717 | |
| 718 | - if($type == 'belongs_to'){ |
|
| 718 | + if ($type == 'belongs_to') { |
|
| 719 | 719 | if (is_object($row)) { |
| 720 | 720 | $row->{$relationship} = $this->{$relationship . '_model'}->get($row->{$options['primary_key']}); |
| 721 | 721 | } else { |
@@ -30,10 +30,10 @@ |
||
| 30 | 30 | |
| 31 | 31 | class DatabaseQueryRunner extends BaseClass { |
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * The DatabaseConnection instance |
|
| 35 | - * @var object |
|
| 36 | - */ |
|
| 33 | + /** |
|
| 34 | + * The DatabaseConnection instance |
|
| 35 | + * @var object |
|
| 36 | + */ |
|
| 37 | 37 | private $connection = null; |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * |
| 94 | 94 | * @codeCoverageIgnore |
| 95 | 95 | */ |
| 96 | - protected function startAppSession() { |
|
| 96 | + protected function startAppSession() { |
|
| 97 | 97 | //$_SESSION is not available on cli mode |
| 98 | 98 | if (!IS_CLI) { |
| 99 | 99 | //set session params |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * @codeCoverageIgnore |
| 144 | 144 | */ |
| 145 | 145 | protected function setAppSessionConfig() { |
| 146 | - //the default is to store in the files |
|
| 146 | + //the default is to store in the files |
|
| 147 | 147 | $sessionHandler = $this->config->get('session_handler', 'files'); |
| 148 | 148 | $this->logger->info('Session handler: ' . $sessionHandler); |
| 149 | 149 | if ($sessionHandler == 'files') { |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | * Remove the DOCUMENT_ROOT and front controller from segments if exists |
| 444 | 444 | * @return void |
| 445 | 445 | */ |
| 446 | - protected function removeDocumentRootFrontControllerFromSegments(){ |
|
| 446 | + protected function removeDocumentRootFrontControllerFromSegments() { |
|
| 447 | 447 | $segment = $this->segments; |
| 448 | 448 | $baseUrl = get_config('base_url'); |
| 449 | 449 | //check if the app is not in DOCUMENT_ROOT |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | break; |
| 562 | 562 | } |
| 563 | 563 | } |
| 564 | - if($findIndex !== -1){ |
|
| 564 | + if ($findIndex !== -1) { |
|
| 565 | 565 | //$args[0] => full string captured by preg_match |
| 566 | 566 | //$args[1], $args[2], $args[n] => contains the value of |
| 567 | 567 | //(:num), (:alpha), (:alnum), (:any) |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | * Find file path of the current controller using the current module |
| 587 | 587 | * @return boolean true if the file path is found otherwise false. |
| 588 | 588 | */ |
| 589 | - protected function findControllerFullPathUsingCurrentModule(){ |
|
| 589 | + protected function findControllerFullPathUsingCurrentModule() { |
|
| 590 | 590 | $path = $this->moduleInstance->findControllerFullPath(ucfirst($this->controller), $this->module); |
| 591 | 591 | if (!$path) { |
| 592 | 592 | $this->logger->info('The controller [' . $this->controller . '] not found in the module, may be will use the module [' . $this->module . '] as controller'); |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | * or the current request does not use module |
| 603 | 603 | * @return void |
| 604 | 604 | */ |
| 605 | - protected function setRouteParamsIfNoModuleOrNotFound(){ |
|
| 605 | + protected function setRouteParamsIfNoModuleOrNotFound() { |
|
| 606 | 606 | $segment = $this->segments; |
| 607 | 607 | //controller |
| 608 | 608 | if (isset($segment[0])) { |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | * or the current request use module |
| 624 | 624 | * @return void |
| 625 | 625 | */ |
| 626 | - protected function setRouteParamsIfAppHasModuleOrFound(){ |
|
| 626 | + protected function setRouteParamsIfAppHasModuleOrFound() { |
|
| 627 | 627 | //get the module list |
| 628 | 628 | $modules = $this->moduleInstance->getModuleList(); |
| 629 | 629 | $segment = $this->segments; |
@@ -636,7 +636,7 @@ discard block |
||
| 636 | 636 | $this->controller = $segment[0]; |
| 637 | 637 | |
| 638 | 638 | //check if the request use the same module name and controller |
| 639 | - if($this->findControllerFullPathUsingCurrentModule()){ |
|
| 639 | + if ($this->findControllerFullPathUsingCurrentModule()) { |
|
| 640 | 640 | array_shift($segment); |
| 641 | 641 | } |
| 642 | 642 | } |