@@ -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 | } |
@@ -343,7 +343,7 @@ |
||
| 343 | 343 | * Get some parameters data need like ip address, hostname, browser info, etc. |
| 344 | 344 | * @return array |
| 345 | 345 | */ |
| 346 | - protected function getSessionDataParams(){ |
|
| 346 | + protected function getSessionDataParams() { |
|
| 347 | 347 | $this->getLoader()->functions('user_agent'); |
| 348 | 348 | $this->getLoader()->library('Browser'); |
| 349 | 349 | |
@@ -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; |
@@ -142,7 +142,7 @@ |
||
| 142 | 142 | * @return string the final path after add suffix if configured |
| 143 | 143 | * otherwise the same value will be returned |
| 144 | 144 | */ |
| 145 | - protected static function addSuffixInPath($path){ |
|
| 145 | + protected static function addSuffixInPath($path) { |
|
| 146 | 146 | $suffix = get_config('url_suffix'); |
| 147 | 147 | if ($suffix && $path) { |
| 148 | 148 | if (strpos($path, '?') !== false) { |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $instance = $db; |
| 152 | 152 | } else { |
| 153 | 153 | $obj = & get_instance(); |
| 154 | - if (isset($obj->database)){ |
|
| 154 | + if (isset($obj->database)) { |
|
| 155 | 155 | /** |
| 156 | 156 | * NOTE: Need use "clone" because some Model need have the personal instance of the database library |
| 157 | 157 | * to prevent duplication |
@@ -730,7 +730,7 @@ discard block |
||
| 730 | 730 | * @return object |
| 731 | 731 | */ |
| 732 | 732 | protected function getLoaderInstanceOrCreate() { |
| 733 | - if (! is_object($this->loaderInstance)) { |
|
| 733 | + if (!is_object($this->loaderInstance)) { |
|
| 734 | 734 | $this->loaderInstance = & get_instance()->loader; |
| 735 | 735 | } |
| 736 | 736 | return $this->loaderInstance; |
@@ -740,7 +740,7 @@ discard block |
||
| 740 | 740 | * Get the return type array or object |
| 741 | 741 | * @return string|boolean |
| 742 | 742 | */ |
| 743 | - protected function getReturnType(){ |
|
| 743 | + protected function getReturnType() { |
|
| 744 | 744 | $type = false; |
| 745 | 745 | if ($this->_temporary_return_type == 'array') { |
| 746 | 746 | $type = 'array'; |
@@ -752,7 +752,7 @@ discard block |
||
| 752 | 752 | * Check if soft delete is enable setting the condition |
| 753 | 753 | * @return object the current instance |
| 754 | 754 | */ |
| 755 | - protected function checkForSoftDelete(){ |
|
| 755 | + protected function checkForSoftDelete() { |
|
| 756 | 756 | if ($this->soft_delete && $this->_temporary_with_deleted !== true) { |
| 757 | 757 | $this->getQueryBuilder()->where($this->soft_delete_key, (bool) $this->_temporary_only_deleted); |
| 758 | 758 | } |
@@ -767,12 +767,12 @@ discard block |
||
| 767 | 767 | * @param string $type the type can be "belongs_to", "has_many" |
| 768 | 768 | * @return mixed the final row values |
| 769 | 769 | */ |
| 770 | - protected function relateBelongsToAndHasMany($relationship, $options, $row, $type){ |
|
| 770 | + protected function relateBelongsToAndHasMany($relationship, $options, $row, $type) { |
|
| 771 | 771 | if (in_array($relationship, $this->_with)) { |
| 772 | 772 | $loaderInstance = $this->getLoaderInstanceOrCreate(); |
| 773 | 773 | $loaderInstance->model($options['model'], $relationship . '_model'); |
| 774 | 774 | |
| 775 | - if($type == 'belongs_to'){ |
|
| 775 | + if ($type == 'belongs_to') { |
|
| 776 | 776 | if (is_object($row)) { |
| 777 | 777 | $row->{$relationship} = $this->{$relationship . '_model'}->get($row->{$options['primary_key']}); |
| 778 | 778 | } else { |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | * |
| 347 | 347 | * @return string|null the full file path |
| 348 | 348 | */ |
| 349 | - protected static function getDefaultFilePathForView($file){ |
|
| 349 | + protected static function getDefaultFilePathForView($file) { |
|
| 350 | 350 | $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH); |
| 351 | 351 | $fullFilePath = null; |
| 352 | 352 | foreach ($searchDir as $dir) { |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | // Parse out the elapsed time and memory usage, |
| 466 | 466 | // then swap the pseudo-variables with the data |
| 467 | 467 | $elapsedTime = $benchmark->elapsedTime('APP_EXECUTION_START', 'APP_EXECUTION_END'); |
| 468 | - $memoryUsage = round($benchmark->memoryUsage('APP_EXECUTION_START', 'APP_EXECUTION_END') / 1024 / 1024, 6) . 'MB'; |
|
| 468 | + $memoryUsage = round($benchmark->memoryUsage('APP_EXECUTION_START', 'APP_EXECUTION_END') / 1024 / 1024, 6) . 'MB'; |
|
| 469 | 469 | return str_replace(array('{elapsed_time}', '{memory_usage}'), array($elapsedTime, $memoryUsage), $content); |
| 470 | 470 | } |
| 471 | 471 | |
@@ -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 | } |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | * Set the file array data generally in constructor this is already set using $_FILES |
| 277 | 277 | * @param array $fileArray the new value |
| 278 | 278 | */ |
| 279 | - public function setFileArray($fileArray){ |
|
| 279 | + public function setFileArray($fileArray) { |
|
| 280 | 280 | $this->file_array = $fileArray; |
| 281 | 281 | } |
| 282 | 282 | |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | * @return string |
| 595 | 595 | */ |
| 596 | 596 | public function getDestinationDirectory() { |
| 597 | - return $this->destination_directory ; |
|
| 597 | + return $this->destination_directory; |
|
| 598 | 598 | } |
| 599 | 599 | |
| 600 | 600 | /** |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | * @return boolean |
| 603 | 603 | */ |
| 604 | 604 | public function isAllowOverwriting() { |
| 605 | - return $this->overwrite_file ; |
|
| 605 | + return $this->overwrite_file; |
|
| 606 | 606 | } |
| 607 | 607 | |
| 608 | 608 | /** |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | * @link http://github.com/eoghanobrien/php-simple-mail |
| 49 | 49 | */ |
| 50 | 50 | |
| 51 | - class Email extends BaseClass{ |
|
| 51 | + class Email extends BaseClass { |
|
| 52 | 52 | /** |
| 53 | 53 | * @var int $_wrap |
| 54 | 54 | */ |