@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $cacheInfo = $cache->getInfo($pageCacheKey); |
250 | 250 | if ($cacheInfo) { |
251 | 251 | $status = $this->sendCacheNotYetExpireInfoToBrowser($cacheInfo); |
252 | - if($status === false) { |
|
252 | + if ($status === false) { |
|
253 | 253 | return $this->sendCachePageContentToBrowser($cache); |
254 | 254 | } |
255 | 255 | return true; |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | */ |
324 | 324 | public function sendError(array $data = array()) { |
325 | 325 | $path = CORE_VIEWS_PATH . 'errors.php'; |
326 | - if(file_exists($path)){ |
|
326 | + if (file_exists($path)) { |
|
327 | 327 | //compress the output if is available |
328 | 328 | $compressOutputHandler = $this->getCompressOutputHandler(); |
329 | 329 | ob_start($compressOutputHandler); |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | echo $content; |
336 | 336 | } |
337 | 337 | //@codeCoverageIgnoreStart |
338 | - else{ |
|
338 | + else { |
|
339 | 339 | //can't use show_error() at this time because |
340 | 340 | //some dependencies not yet loaded |
341 | 341 | set_http_status_header(503); |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | * |
390 | 390 | * @return string|null the full file path |
391 | 391 | */ |
392 | - protected function getDefaultFilePathForView($file){ |
|
392 | + protected function getDefaultFilePathForView($file) { |
|
393 | 393 | $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH); |
394 | 394 | $fullFilePath = null; |
395 | 395 | foreach ($searchDir as $dir) { |
@@ -425,10 +425,10 @@ discard block |
||
425 | 425 | * @return object the current instance |
426 | 426 | */ |
427 | 427 | protected function filterValidationData() { |
428 | - foreach ($this->data as $key => $value ) { |
|
428 | + foreach ($this->data as $key => $value) { |
|
429 | 429 | if (is_string($value)) { |
430 | 430 | $this->data[$key] = trim($value); |
431 | - } else if(is_array($value)) { |
|
431 | + } else if (is_array($value)) { |
|
432 | 432 | $this->data[$key] = array_map('trim', $value); |
433 | 433 | } |
434 | 434 | } |
@@ -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 | } |
@@ -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 |
@@ -214,7 +214,7 @@ |
||
214 | 214 | protected function getLogDebugBacktraceInfo() { |
215 | 215 | $dtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); |
216 | 216 | $i = 0; |
217 | - while ($dtrace[$i]['file'] == __FILE__ ) { |
|
217 | + while ($dtrace[$i]['file'] == __FILE__) { |
|
218 | 218 | $i++; |
219 | 219 | } |
220 | 220 | $fileInfo = $dtrace[$i]; |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | $keysList = 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 | $keysList[] = $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; |
@@ -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 | //$args[0] => full string captured by preg_match |
586 | 586 | //$args[1], $args[2], $args[n] => contains the value of |
587 | 587 | //(:num), (:alpha), (:alnum), (:any) |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | * Find file path of the current controller using the current module |
607 | 607 | * @return boolean true if the file path is found otherwise false. |
608 | 608 | */ |
609 | - protected function findControllerFullPathUsingCurrentModule(){ |
|
609 | + protected function findControllerFullPathUsingCurrentModule() { |
|
610 | 610 | $path = $this->moduleInstance->findControllerFullPath(ucfirst($this->controller), $this->module); |
611 | 611 | if (!$path) { |
612 | 612 | $this->logger->info('The controller [' . $this->controller . '] not ' |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | * or the current request does not use module |
624 | 624 | * @return void |
625 | 625 | */ |
626 | - protected function setRouteParamsIfNoModuleOrNotFound(){ |
|
626 | + protected function setRouteParamsIfNoModuleOrNotFound() { |
|
627 | 627 | $segment = $this->segments; |
628 | 628 | //controller |
629 | 629 | if (isset($segment[0])) { |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | * or the current request use module |
645 | 645 | * @return void |
646 | 646 | */ |
647 | - protected function setRouteParamsIfAppHasModuleOrFound(){ |
|
647 | + protected function setRouteParamsIfAppHasModuleOrFound() { |
|
648 | 648 | //get the module list |
649 | 649 | $modules = $this->moduleInstance->getModuleList(); |
650 | 650 | $segment = $this->segments; |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | $this->controller = $segment[0]; |
658 | 658 | |
659 | 659 | //check if the request use the same module name and controller |
660 | - if($this->findControllerFullPathUsingCurrentModule()){ |
|
660 | + if ($this->findControllerFullPathUsingCurrentModule()) { |
|
661 | 661 | array_shift($segment); |
662 | 662 | } |
663 | 663 | } |
@@ -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 | */ |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | $message = $this->getWrapMessage(); |
979 | 979 | if ($this->hasAttachments()) { |
980 | 980 | $this->setAttachmentHeaders(); |
981 | - $message = $this->assembleAttachmentBody(); |
|
981 | + $message = $this->assembleAttachmentBody(); |
|
982 | 982 | } |
983 | 983 | return $message; |
984 | 984 | } |
@@ -1072,7 +1072,7 @@ discard block |
||
1072 | 1072 | $this->smtpConnectionTimeout |
1073 | 1073 | ); |
1074 | 1074 | |
1075 | - if (! is_resource($this->smtpSocket)) { |
|
1075 | + if (!is_resource($this->smtpSocket)) { |
|
1076 | 1076 | $this->error = $errorNumber . ':' . $errorMessage; |
1077 | 1077 | return false; |
1078 | 1078 | } |
@@ -1121,7 +1121,7 @@ discard block |
||
1121 | 1121 | */ |
1122 | 1122 | if (is_resource($this->smtpSocket)) { |
1123 | 1123 | $method = STREAM_CRYPTO_METHOD_TLS_CLIENT; |
1124 | - if(version_compare(PHP_VERSION, '5.6', '>=')) { |
|
1124 | + if (version_compare(PHP_VERSION, '5.6', '>=')) { |
|
1125 | 1125 | $method = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; |
1126 | 1126 | } |
1127 | 1127 | stream_socket_enable_crypto($this->smtpSocket, true, $method); |
@@ -1188,7 +1188,7 @@ discard block |
||
1188 | 1188 | 'To' => $to |
1189 | 1189 | ); |
1190 | 1190 | foreach ($additionalHeaders as $key => $value) { |
1191 | - if (! isset($this->headers[$key])) { |
|
1191 | + if (!isset($this->headers[$key])) { |
|
1192 | 1192 | $this->headers[$key] = $value; |
1193 | 1193 | } |
1194 | 1194 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | static $cfg; |
148 | 148 | if (empty($cfg)) { |
149 | 149 | $cfg[0] = & load_configurations(); |
150 | - if(! is_array($cfg[0])){ |
|
150 | + if (!is_array($cfg[0])) { |
|
151 | 151 | $cfg[0] = array(); |
152 | 152 | } |
153 | 153 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | set_http_status_header(500); |
198 | 198 | } |
199 | 199 | $errorType = 'Error'; |
200 | - $errorsType = array ( |
|
200 | + $errorsType = array( |
|
201 | 201 | E_ERROR => 'Error', |
202 | 202 | E_WARNING => 'Warning', |
203 | 203 | E_PARSE => 'Parsing Error', |