@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | * Remove the DOCUMENT_ROOT and front controller from segments if exists |
| 451 | 451 | * @return void |
| 452 | 452 | */ |
| 453 | - protected function removeDocumentRootFrontControllerFromSegments(){ |
|
| 453 | + protected function removeDocumentRootFrontControllerFromSegments() { |
|
| 454 | 454 | $segment = $this->segments; |
| 455 | 455 | $globals = & class_loader('GlobalVar', 'classes'); |
| 456 | 456 | $rootFolder = substr($globals->server('SCRIPT_NAME'), 0, strpos( |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | break; |
| 582 | 582 | } |
| 583 | 583 | } |
| 584 | - if($findIndex !== -1){ |
|
| 584 | + if ($findIndex !== -1) { |
|
| 585 | 585 | /* |
| 586 | 586 | * $args[0] => full string captured by preg_match |
| 587 | 587 | * $args[1], $args[2], $args[n] => contains the value of |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | * Find file path of the current controller using the current module |
| 609 | 609 | * @return boolean true if the file path is found otherwise false. |
| 610 | 610 | */ |
| 611 | - protected function findControllerFullPathUsingCurrentModule(){ |
|
| 611 | + protected function findControllerFullPathUsingCurrentModule() { |
|
| 612 | 612 | $path = $this->moduleInstance->findControllerFullPath(ucfirst($this->controller), $this->module); |
| 613 | 613 | if (!$path) { |
| 614 | 614 | $this->logger->info('The controller [' . $this->controller . '] not ' |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | * or the current request does not use module |
| 626 | 626 | * @return void |
| 627 | 627 | */ |
| 628 | - protected function setRouteParamsIfNoModuleOrNotFound(){ |
|
| 628 | + protected function setRouteParamsIfNoModuleOrNotFound() { |
|
| 629 | 629 | $segment = $this->segments; |
| 630 | 630 | //controller |
| 631 | 631 | if (isset($segment[0])) { |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | * or the current request use module |
| 647 | 647 | * @return void |
| 648 | 648 | */ |
| 649 | - protected function setRouteParamsIfAppHasModuleOrFound(){ |
|
| 649 | + protected function setRouteParamsIfAppHasModuleOrFound() { |
|
| 650 | 650 | //get the module list |
| 651 | 651 | $modules = $this->moduleInstance->getModuleList(); |
| 652 | 652 | $segment = $this->segments; |
@@ -658,7 +658,7 @@ discard block |
||
| 658 | 658 | if (isset($segment[0])) { |
| 659 | 659 | $this->controller = $segment[0]; |
| 660 | 660 | //check if the request use the same module name and controller |
| 661 | - if($this->findControllerFullPathUsingCurrentModule()){ |
|
| 661 | + if ($this->findControllerFullPathUsingCurrentModule()) { |
|
| 662 | 662 | array_shift($segment); |
| 663 | 663 | } |
| 664 | 664 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | //reset instance |
| 101 | 101 | $this->reset(); |
| 102 | 102 | |
| 103 | - $this->logger->debug('Begin execution of SQL query [' . $this->query .']'); |
|
| 103 | + $this->logger->debug('Begin execution of SQL query [' . $this->query . ']'); |
|
| 104 | 104 | |
| 105 | 105 | //for database query execution time |
| 106 | 106 | $benchmarkMarkerKey = $this->getBenchmarkKey(); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | if ((double) $responseTime >= 1.000000) { |
| 118 | 118 | $this->logger->warning( |
| 119 | 119 | 'High response time while processing database query [' . $this->query . '].' |
| 120 | - . ' The response time is [' .$responseTime . '] sec.' |
|
| 120 | + . ' The response time is [' . $responseTime . '] sec.' |
|
| 121 | 121 | ); |
| 122 | 122 | } |
| 123 | 123 | |
@@ -137,7 +137,7 @@ |
||
| 137 | 137 | */ |
| 138 | 138 | $TIMEZONE = get_config('server_timezone', 'UTC'); |
| 139 | 139 | if (!date_default_timezone_set($TIMEZONE)) { |
| 140 | - show_error('Invalid server timezone configuration "' .$TIMEZONE. '"'); |
|
| 140 | + show_error('Invalid server timezone configuration "' . $TIMEZONE . '"'); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | /** |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | */ |
| 59 | 59 | public function add($name) { |
| 60 | 60 | if (in_array($name, $this->list)) { |
| 61 | - $this->logger->warning('The module [' .$name. '] already added skipping.'); |
|
| 61 | + $this->logger->warning('The module [' . $name . '] already added skipping.'); |
|
| 62 | 62 | return $this; |
| 63 | 63 | } |
| 64 | 64 | $this->list[] = $name; |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | protected function getLogDebugBacktraceInfo() { |
| 318 | 318 | $dtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); |
| 319 | 319 | $i = 0; |
| 320 | - while ($dtrace[$i]['file'] == __FILE__ ) { |
|
| 320 | + while ($dtrace[$i]['file'] == __FILE__) { |
|
| 321 | 321 | $i++; |
| 322 | 322 | } |
| 323 | 323 | $fileInfo = $dtrace[$i]; |
@@ -333,11 +333,11 @@ discard block |
||
| 333 | 333 | if (isset($fileInfo['line'])) { |
| 334 | 334 | $line = $fileInfo['line']; |
| 335 | 335 | } |
| 336 | - if (isset($dtrace[$i+1]['function'])) { |
|
| 337 | - $function = $dtrace[$i+1]['function']; |
|
| 336 | + if (isset($dtrace[$i + 1]['function'])) { |
|
| 337 | + $function = $dtrace[$i + 1]['function']; |
|
| 338 | 338 | } |
| 339 | - if (isset($dtrace[$i+1]['class'])) { |
|
| 340 | - $class = $dtrace[$i+1]['class']; |
|
| 339 | + if (isset($dtrace[$i + 1]['class'])) { |
|
| 340 | + $class = $dtrace[$i + 1]['class']; |
|
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | return array( |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | public function connect() { |
| 122 | 122 | try { |
| 123 | - if(empty($this->config) && file_exists(CONFIG_PATH . 'database.php')) { |
|
| 123 | + if (empty($this->config) && file_exists(CONFIG_PATH . 'database.php')) { |
|
| 124 | 124 | $db = array(); |
| 125 | 125 | require CONFIG_PATH . 'database.php'; |
| 126 | 126 | //Note need use the method to set config |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ |
| 131 | 131 | ); |
| 132 | 132 | $this->pdo = new PDO($this->getDsn(), $this->getUsername(), $this->getPassword(), $options); |
| 133 | - if($this->getDriver() == 'mysql') { |
|
| 133 | + if ($this->getDriver() == 'mysql') { |
|
| 134 | 134 | $this->pdo->exec("SET NAMES '" . $this->getCharset() . "' COLLATE '" . $this->getCollation() . "'"); |
| 135 | 135 | $this->pdo->exec("SET CHARACTER SET '" . $this->getCharset() . "'"); |
| 136 | 136 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | public function getCacheContent() { |
| 158 | 158 | //set some attributes values |
| 159 | 159 | $this->setPropertiesValues(); |
| 160 | - if (! $this->canUseCache()) { |
|
| 160 | + if (!$this->canUseCache()) { |
|
| 161 | 161 | $this->logger->info('The cache is not enabled for this query or is not a SELECT query'); |
| 162 | 162 | return null; |
| 163 | 163 | } |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | public function setCacheContent($result) { |
| 179 | 179 | //set some attributes values |
| 180 | 180 | $this->setPropertiesValues(); |
| 181 | - if (! $this->canUseCache()) { |
|
| 181 | + if (!$this->canUseCache()) { |
|
| 182 | 182 | $this->logger->info('The cache is not enabled for this query or is not a SELECT query'); |
| 183 | 183 | return null; |
| 184 | 184 | } |
@@ -443,7 +443,7 @@ |
||
| 443 | 443 | * @return boolean |
| 444 | 444 | */ |
| 445 | 445 | public function isAllowOverwriting() { |
| 446 | - return $this->overwriteFile ; |
|
| 446 | + return $this->overwriteFile; |
|
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | /** |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * SOFTWARE. |
| 29 | 29 | */ |
| 30 | 30 | |
| 31 | - class Email extends BaseClass{ |
|
| 31 | + class Email extends BaseClass { |
|
| 32 | 32 | /** |
| 33 | 33 | * @var int $wrap |
| 34 | 34 | */ |
@@ -746,7 +746,7 @@ discard block |
||
| 746 | 746 | $message = wordwrap($this->message, $this->wrap); |
| 747 | 747 | if ($this->hasAttachments()) { |
| 748 | 748 | $this->setAttachmentHeaders(); |
| 749 | - $message = $this->assembleAttachmentBody(); |
|
| 749 | + $message = $this->assembleAttachmentBody(); |
|
| 750 | 750 | } |
| 751 | 751 | return $message; |
| 752 | 752 | } |
@@ -826,7 +826,7 @@ discard block |
||
| 826 | 826 | $this->smtpConfig['connection_timeout'] |
| 827 | 827 | ); |
| 828 | 828 | |
| 829 | - if (! is_resource($this->smtpSocket)) { |
|
| 829 | + if (!is_resource($this->smtpSocket)) { |
|
| 830 | 830 | $this->error = $errorNumber . ': ' . $errorMessage; |
| 831 | 831 | return false; |
| 832 | 832 | } |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | */ |
| 876 | 876 | if (is_resource($this->smtpSocket)) { |
| 877 | 877 | $method = STREAM_CRYPTO_METHOD_TLS_CLIENT; |
| 878 | - if(version_compare(PHP_VERSION, '5.6', '>=')) { |
|
| 878 | + if (version_compare(PHP_VERSION, '5.6', '>=')) { |
|
| 879 | 879 | $method = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; |
| 880 | 880 | } |
| 881 | 881 | stream_socket_enable_crypto($this->smtpSocket, true, $method); |
@@ -983,7 +983,7 @@ discard block |
||
| 983 | 983 | 'To' => $to |
| 984 | 984 | ); |
| 985 | 985 | foreach ($additionalHeaders as $key => $value) { |
| 986 | - if (! isset($this->headers[$key])) { |
|
| 986 | + if (!isset($this->headers[$key])) { |
|
| 987 | 987 | $this->headers[$key] = $value; |
| 988 | 988 | } |
| 989 | 989 | } |