@@ -148,7 +148,7 @@ |
||
| 148 | 148 | static $cfg; |
| 149 | 149 | if (empty($cfg)) { |
| 150 | 150 | $cfg[0] = & load_configurations(); |
| 151 | - if(! is_array($cfg[0])){ |
|
| 151 | + if (!is_array($cfg[0])) { |
|
| 152 | 152 | $cfg[0] = array(); |
| 153 | 153 | } |
| 154 | 154 | } |
@@ -410,7 +410,7 @@ |
||
| 410 | 410 | * |
| 411 | 411 | * @return object|void |
| 412 | 412 | */ |
| 413 | - protected function setConnectionUsingConfigFile(){ |
|
| 413 | + protected function setConnectionUsingConfigFile() { |
|
| 414 | 414 | $dbConfigFromFile = $this->getDatabaseConfigFromFile(); |
| 415 | 415 | $connection = &class_loader('DatabaseConnection', 'classes/database'); |
| 416 | 416 | $connection->setConfig($dbConfigFromFile); |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | $_keys = array(); |
| 415 | 415 | foreach ($keys as $k => $v) { |
| 416 | 416 | $v = $this->checkForNullValue($v); |
| 417 | - if (! is_numeric($v)) { |
|
| 417 | + if (!is_numeric($v)) { |
|
| 418 | 418 | $v = $this->connection->escape($v, $escape); |
| 419 | 419 | } |
| 420 | 420 | $_keys[] = $v; |
@@ -727,7 +727,7 @@ discard block |
||
| 727 | 727 | * |
| 728 | 728 | * @return string|null |
| 729 | 729 | */ |
| 730 | - protected function buildQueryPart($property, $command = ''){ |
|
| 730 | + protected function buildQueryPart($property, $command = '') { |
|
| 731 | 731 | if (!empty($this->{$property})) { |
| 732 | 732 | return $command . $this->{$property}; |
| 733 | 733 | } |
@@ -742,7 +742,7 @@ discard block |
||
| 742 | 742 | * @param string $clause the clause type "IS NULL", "IS NOT NULLs" |
| 743 | 743 | * @return object the current DatabaseQueryBuilder instance |
| 744 | 744 | */ |
| 745 | - protected function whereIsNullAndNotNull($field, $andOr = 'AND', $clause = 'IS NULL'){ |
|
| 745 | + protected function whereIsNullAndNotNull($field, $andOr = 'AND', $clause = 'IS NULL') { |
|
| 746 | 746 | if (is_array($field)) { |
| 747 | 747 | foreach ($field as $f) { |
| 748 | 748 | $this->whereIsNullAndNotNull($f, $andOr, $clause); |
@@ -760,7 +760,7 @@ discard block |
||
| 760 | 760 | * |
| 761 | 761 | * @return object the current instance |
| 762 | 762 | */ |
| 763 | - protected function setSelectStr($newSelect){ |
|
| 763 | + protected function setSelectStr($newSelect) { |
|
| 764 | 764 | $this->select = (($this->select == '*' || empty($this->select)) |
| 765 | 765 | ? $newSelect |
| 766 | 766 | : $this->select . ', ' . $newSelect); |
@@ -774,8 +774,8 @@ discard block |
||
| 774 | 774 | * @return string the empty string if the value is null |
| 775 | 775 | * otherwise the same value will be returned |
| 776 | 776 | */ |
| 777 | - protected function checkForNullValue($value){ |
|
| 778 | - if(is_null($value)){ |
|
| 777 | + protected function checkForNullValue($value) { |
|
| 778 | + if (is_null($value)) { |
|
| 779 | 779 | return ''; |
| 780 | 780 | } |
| 781 | 781 | return $value; |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | * @return object the current instance |
| 425 | 425 | */ |
| 426 | 426 | protected function filterValidationData() { |
| 427 | - foreach ($this->data as $key => $value ) { |
|
| 427 | + foreach ($this->data as $key => $value) { |
|
| 428 | 428 | if (is_array($value)) { |
| 429 | 429 | $this->data[$key] = array_map('trim', $value); |
| 430 | 430 | } else { |
@@ -1037,7 +1037,7 @@ discard block |
||
| 1037 | 1037 | if (call_user_func_array($paramValue, array($value)) === false) { |
| 1038 | 1038 | $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
| 1039 | 1039 | } |
| 1040 | - } else{ |
|
| 1040 | + } else { |
|
| 1041 | 1041 | $this->forceError = true; |
| 1042 | 1042 | show_error('The callback validation function/method "' . $paramValue . '" does not exist'); |
| 1043 | 1043 | } |
@@ -121,7 +121,7 @@ |
||
| 121 | 121 | if ((double) $responseTime >= 1.000000) { |
| 122 | 122 | $this->logger->warning( |
| 123 | 123 | 'High response time while processing database query [' . $this->query . '].' |
| 124 | - . 'The response time is [' .$responseTime . '] sec.' |
|
| 124 | + . 'The response time is [' . $responseTime . '] sec.' |
|
| 125 | 125 | ); |
| 126 | 126 | } |
| 127 | 127 | |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | * @param string $appLang the application language, only if type = "language" |
| 309 | 309 | * @return string|null the full file path |
| 310 | 310 | */ |
| 311 | - protected function getDefaultFilePathForFunctionLanguage($file, $type, $appLang = null){ |
|
| 311 | + protected function getDefaultFilePathForFunctionLanguage($file, $type, $appLang = null) { |
|
| 312 | 312 | $searchDir = null; |
| 313 | 313 | if ($type == 'function') { |
| 314 | 314 | $searchDir = array(FUNCTIONS_PATH, CORE_FUNCTIONS_PATH); |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | * @param string|null $module the module if is not null will return it |
| 335 | 335 | * @return string|null |
| 336 | 336 | */ |
| 337 | - protected function getModuleFromSuperController($module){ |
|
| 337 | + protected function getModuleFromSuperController($module) { |
|
| 338 | 338 | $obj = & get_instance(); |
| 339 | 339 | if (!$module && !empty($obj->moduleName)) { |
| 340 | 340 | $module = $obj->moduleName; |
@@ -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; |
@@ -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 | } |
@@ -369,7 +369,7 @@ |
||
| 369 | 369 | * |
| 370 | 370 | * @return string|null the full file path |
| 371 | 371 | */ |
| 372 | - protected function getDefaultFilePathForView($file){ |
|
| 372 | + protected function getDefaultFilePathForView($file) { |
|
| 373 | 373 | $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH); |
| 374 | 374 | $fullFilePath = null; |
| 375 | 375 | foreach ($searchDir as $dir) { |