@@ -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 | } |
@@ -99,7 +99,7 @@ |
||
99 | 99 | * @return object the current instance |
100 | 100 | */ |
101 | 101 | public function setFilename($filename) { |
102 | - if(stripos($filename, '.pdf') === false) { |
|
102 | + if (stripos($filename, '.pdf') === false) { |
|
103 | 103 | $filename .= '.pdf'; |
104 | 104 | } |
105 | 105 | $this->filename = $filename; |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | $keysList = array(); |
411 | 411 | foreach ($keys as $k => $v) { |
412 | 412 | $v = $this->checkForNullValue($v); |
413 | - if (! is_numeric($v)) { |
|
413 | + if (!is_numeric($v)) { |
|
414 | 414 | $v = $this->connection->escape($v, $escape); |
415 | 415 | } |
416 | 416 | $keysList[] = $v; |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | * |
722 | 722 | * @return string|null |
723 | 723 | */ |
724 | - protected function buildQueryPart($property, $command = ''){ |
|
724 | + protected function buildQueryPart($property, $command = '') { |
|
725 | 725 | if (!empty($this->{$property})) { |
726 | 726 | return $command . $this->{$property}; |
727 | 727 | } |
@@ -736,7 +736,7 @@ discard block |
||
736 | 736 | * @param string $clause the clause type "IS NULL", "IS NOT NULLs" |
737 | 737 | * @return object the current DatabaseQueryBuilder instance |
738 | 738 | */ |
739 | - protected function whereIsNullAndNotNull($field, $andOr = 'AND', $clause = 'IS NULL'){ |
|
739 | + protected function whereIsNullAndNotNull($field, $andOr = 'AND', $clause = 'IS NULL') { |
|
740 | 740 | if (is_array($field)) { |
741 | 741 | foreach ($field as $f) { |
742 | 742 | $this->whereIsNullAndNotNull($f, $andOr, $clause); |
@@ -754,7 +754,7 @@ discard block |
||
754 | 754 | * |
755 | 755 | * @return object the current instance |
756 | 756 | */ |
757 | - protected function setSelectStr($newSelect){ |
|
757 | + protected function setSelectStr($newSelect) { |
|
758 | 758 | $this->select = (($this->select == '*' || empty($this->select)) |
759 | 759 | ? $newSelect |
760 | 760 | : $this->select . ', ' . $newSelect); |
@@ -768,8 +768,8 @@ discard block |
||
768 | 768 | * @return string the empty string if the value is null |
769 | 769 | * otherwise the same value will be returned |
770 | 770 | */ |
771 | - protected function checkForNullValue($value){ |
|
772 | - if(is_null($value)){ |
|
771 | + protected function checkForNullValue($value) { |
|
772 | + if (is_null($value)) { |
|
773 | 773 | return ''; |
774 | 774 | } |
775 | 775 | return $value; |
@@ -796,7 +796,7 @@ discard block |
||
796 | 796 | * |
797 | 797 | * @return string |
798 | 798 | */ |
799 | - protected function getWhereStrForOperator($where, $op = null, $value= null, $type = '', $escape = true) { |
|
799 | + protected function getWhereStrForOperator($where, $op = null, $value = null, $type = '', $escape = true) { |
|
800 | 800 | $w = ''; |
801 | 801 | if (!in_array((string) $op, $this->operatorList)) { |
802 | 802 | $op = $this->checkForNullValue($op); |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | * @param int $currentPageNumber the current page number |
88 | 88 | * @return array |
89 | 89 | */ |
90 | - public function getInfos($totalRows, $currentPageNumber){ |
|
91 | - $numberOfRowPerPage = (int)$this->config['pagination_per_page']; |
|
92 | - $numberOfPage = (int)ceil($totalRows / $numberOfRowPerPage); |
|
93 | - $numberOfLink = (int)$this->config['nb_link']; |
|
90 | + public function getInfos($totalRows, $currentPageNumber) { |
|
91 | + $numberOfRowPerPage = (int) $this->config['pagination_per_page']; |
|
92 | + $numberOfPage = (int) ceil($totalRows / $numberOfRowPerPage); |
|
93 | + $numberOfLink = (int) $this->config['nb_link']; |
|
94 | 94 | $infos['current_page'] = $currentPageNumber; |
95 | 95 | $infos['num_links'] = $numberOfLink; |
96 | 96 | $infos['limit'] = $numberOfRowPerPage; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | //determine the pagination query string value |
122 | 122 | $this->determinePaginationQueryStringValue(); |
123 | 123 | |
124 | - $currentPageNumber = (int)$currentPageNumber; |
|
124 | + $currentPageNumber = (int) $currentPageNumber; |
|
125 | 125 | |
126 | 126 | if ($currentPageNumber <= 0) { |
127 | 127 | $currentPageNumber = 1; |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $language = trim($language, '/\\'); |
255 | 255 | $language = str_ireplace('lang_', '', $language); |
256 | 256 | $file = 'lang_' . $language . '.php'; |
257 | - if(!$langCode){ |
|
257 | + if (!$langCode) { |
|
258 | 258 | //get the current language |
259 | 259 | $langCode = $this->getAppLang(); |
260 | 260 | } |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | * @param string $appLang the application language, only if type = "language" |
336 | 336 | * @return string|null the full file path |
337 | 337 | */ |
338 | - protected function getDefaultFilePathForFunctionLanguage($file, $type, $appLang = null){ |
|
338 | + protected function getDefaultFilePathForFunctionLanguage($file, $type, $appLang = null) { |
|
339 | 339 | //Default to "function" |
340 | 340 | $searchDir = array(FUNCTIONS_PATH, CORE_FUNCTIONS_PATH); |
341 | 341 | if ($type == 'language') { |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | * @param string|null $module the module if is not null will return it |
360 | 360 | * @return string|null |
361 | 361 | */ |
362 | - protected function getModuleFromSuperController($module){ |
|
362 | + protected function getModuleFromSuperController($module) { |
|
363 | 363 | $obj = & get_instance(); |
364 | 364 | if (!$module && !empty($obj->moduleName)) { |
365 | 365 | $module = $obj->moduleName; |