@@ -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 | } |
@@ -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', |
@@ -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 saveCacheContent($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 | } |
@@ -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 | */ |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | $message = $this->getWrapMessage(); |
846 | 846 | if ($this->hasAttachments()) { |
847 | 847 | $this->setAttachmentHeaders(); |
848 | - $message = $this->assembleAttachmentBody(); |
|
848 | + $message = $this->assembleAttachmentBody(); |
|
849 | 849 | } |
850 | 850 | return $message; |
851 | 851 | } |
@@ -925,7 +925,7 @@ discard block |
||
925 | 925 | $this->getSmtpConfig('connection_timeout', 30) |
926 | 926 | ); |
927 | 927 | |
928 | - if (! is_resource($this->smtpSocket)) { |
|
928 | + if (!is_resource($this->smtpSocket)) { |
|
929 | 929 | $this->error = $errorNumber . ': ' . $errorMessage; |
930 | 930 | return false; |
931 | 931 | } |
@@ -974,7 +974,7 @@ discard block |
||
974 | 974 | */ |
975 | 975 | if (is_resource($this->smtpSocket)) { |
976 | 976 | $method = STREAM_CRYPTO_METHOD_TLS_CLIENT; |
977 | - if(version_compare(PHP_VERSION, '5.6', '>=')) { |
|
977 | + if (version_compare(PHP_VERSION, '5.6', '>=')) { |
|
978 | 978 | $method = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; |
979 | 979 | } |
980 | 980 | stream_socket_enable_crypto($this->smtpSocket, true, $method); |
@@ -1041,7 +1041,7 @@ discard block |
||
1041 | 1041 | 'To' => $to |
1042 | 1042 | ); |
1043 | 1043 | foreach ($additionalHeaders as $key => $value) { |
1044 | - if (! isset($this->headers[$key])) { |
|
1044 | + if (!isset($this->headers[$key])) { |
|
1045 | 1045 | $this->headers[$key] = $value; |
1046 | 1046 | } |
1047 | 1047 | } |
@@ -443,10 +443,10 @@ discard block |
||
443 | 443 | * @return object the current instance |
444 | 444 | */ |
445 | 445 | protected function filterValidationData() { |
446 | - foreach ($this->data as $key => $value ) { |
|
446 | + foreach ($this->data as $key => $value) { |
|
447 | 447 | if (is_string($value)) { |
448 | 448 | $this->data[$key] = trim($value); |
449 | - } else if(is_array($value)) { |
|
449 | + } else if (is_array($value)) { |
|
450 | 450 | $this->data[$key] = array_map('trim', $value); |
451 | 451 | } |
452 | 452 | } |
@@ -1161,7 +1161,7 @@ discard block |
||
1161 | 1161 | $rule, |
1162 | 1162 | $paramValue |
1163 | 1163 | ); |
1164 | - } else{ |
|
1164 | + } else { |
|
1165 | 1165 | $this->forceError = true; |
1166 | 1166 | show_error('The callback validation function/method "' . $paramValue . '" does not exist'); |
1167 | 1167 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * Reset all properties |
145 | 145 | */ |
146 | 146 | public function reset() { |
147 | - $this->agent = get_instance()->globalvar->server('HTTP_USER_AGENT'); |
|
147 | + $this->agent = get_instance()->globalvar->server('HTTP_USER_AGENT'); |
|
148 | 148 | $this->browserName = 'unknown'; |
149 | 149 | $this->version = 'unknown'; |
150 | 150 | $this->platform = 'unknown'; |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | */ |
251 | 251 | protected function checkPlatform() { |
252 | 252 | foreach ($this->platforms as $regex => $value) { |
253 | - if (preg_match($regex, $this->agent) ) { |
|
253 | + if (preg_match($regex, $this->agent)) { |
|
254 | 254 | $this->platform = $value; |
255 | 255 | break; |
256 | 256 | } |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | */ |
263 | 263 | protected function checkBrowser() { |
264 | 264 | foreach ($this->browsers as $regex => $value) { |
265 | - if (preg_match($regex, $this->agent ) ) { |
|
265 | + if (preg_match($regex, $this->agent)) { |
|
266 | 266 | $this->browserName = $value; |
267 | 267 | break; |
268 | 268 | } |
@@ -272,10 +272,10 @@ discard block |
||
272 | 272 | /** |
273 | 273 | * Routine to determine the browser version |
274 | 274 | */ |
275 | - protected function checkBrowserVersion(){ |
|
275 | + protected function checkBrowserVersion() { |
|
276 | 276 | $detected = $this->getBrowser(); |
277 | 277 | $detect = array_search($detected, $this->browsers); |
278 | - $browser = str_replace(array('/i','/'), '', $detect); |
|
278 | + $browser = str_replace(array('/i', '/'), '', $detect); |
|
279 | 279 | $regex = "/(?<browser>version|{$browser})[\/]+(?<version>[0-9.|a-zA-Z.]*)/i"; |
280 | 280 | if (preg_match_all($regex, $this->agent, $matches)) { |
281 | 281 | $found = array_search($browser, $matches['browser']); |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | */ |
289 | 289 | protected function checkMobile() { |
290 | 290 | if (preg_match('/(android|avantgo|blackberry|bolt|boost|cricket' |
291 | - . '|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i', $this->agent) ) { |
|
291 | + . '|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i', $this->agent)) { |
|
292 | 292 | $this->isMobile = true; |
293 | 293 | } |
294 | 294 | } |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | * Determine if the browser is Tablet or not |
298 | 298 | */ |
299 | 299 | protected function checkTablet() { |
300 | - if (preg_match('/tablet|ipad/i', $this->agent) ) { |
|
300 | + if (preg_match('/tablet|ipad/i', $this->agent)) { |
|
301 | 301 | $this->isTablet = true; |
302 | 302 | } |
303 | 303 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | * Determine if the browser is Robot or not |
307 | 307 | */ |
308 | 308 | protected function checkBot() { |
309 | - if (preg_match('/bot/i', $this->agent) ) { |
|
309 | + if (preg_match('/bot/i', $this->agent)) { |
|
310 | 310 | $this->isRobot = true; |
311 | 311 | } |
312 | 312 | } |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | if (stristr($this->agent, 'FacebookExternalHit')) { |
319 | 319 | $this->isRobot = true; |
320 | 320 | $this->isFacebook = true; |
321 | - } else if (stristr($this->agent, 'FBIOS')) { |
|
321 | + } else if (stristr($this->agent, 'FBIOS')) { |
|
322 | 322 | $this->isFacebook = true; |
323 | 323 | } |
324 | 324 | } |