@@ -355,13 +355,13 @@ discard block |
||
| 355 | 355 | public function setMessage() { |
| 356 | 356 | $numArgs = func_num_args(); |
| 357 | 357 | if ($numArgs == 2) { |
| 358 | - foreach ($this->post(null) as $key => $val) { |
|
| 358 | + foreach ($this->post(null) as $key => $val) { |
|
| 359 | 359 | $this->_errorMsgOverrides[$key][func_get_arg(0)] = func_get_arg(1); |
| 360 | 360 | } |
| 361 | 361 | return true; |
| 362 | 362 | } else if ($numArgs == 3) { |
| 363 | 363 | $this->_errorMsgOverrides[func_get_arg(1)][func_get_arg(0)] = func_get_arg(2); |
| 364 | - return true; |
|
| 364 | + return true; |
|
| 365 | 365 | } |
| 366 | 366 | return false; |
| 367 | 367 | } |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | if (!empty($regexRule[0])) { |
| 469 | 469 | $ruleSets[] = $regexRule[0]; |
| 470 | 470 | } |
| 471 | - $ruleStringRegex = explode('|', $ruleStringTemp); |
|
| 471 | + $ruleStringRegex = explode('|', $ruleStringTemp); |
|
| 472 | 472 | foreach ($ruleStringRegex as $rule) { |
| 473 | 473 | $rule = trim($rule); |
| 474 | 474 | if ($rule) { |
@@ -277,7 +277,7 @@ |
||
| 277 | 277 | * Set the file array data generally in constructor this is already set using $_FILES |
| 278 | 278 | * @param array $fileArray the new value |
| 279 | 279 | */ |
| 280 | - public function setFileArray($fileArray){ |
|
| 280 | + public function setFileArray($fileArray) { |
|
| 281 | 281 | $this->file_array = $fileArray; |
| 282 | 282 | } |
| 283 | 283 | |
@@ -196,13 +196,13 @@ |
||
| 196 | 196 | return $session; |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - /** |
|
| 200 | - * Get the value from $_GET, $_POST, $_SERVER etc. for given key. if the key is empty will return the all values |
|
| 201 | - * @param string $type the type can be "post", "get", etc. |
|
| 202 | - * @param string $key the item key to be fetched |
|
| 203 | - * @param boolean $xss if need apply some XSS rule on the value |
|
| 204 | - * @return array|mixed the item value if the key exists or all array if the key is null |
|
| 205 | - */ |
|
| 199 | + /** |
|
| 200 | + * Get the value from $_GET, $_POST, $_SERVER etc. for given key. if the key is empty will return the all values |
|
| 201 | + * @param string $type the type can be "post", "get", etc. |
|
| 202 | + * @param string $key the item key to be fetched |
|
| 203 | + * @param boolean $xss if need apply some XSS rule on the value |
|
| 204 | + * @return array|mixed the item value if the key exists or all array if the key is null |
|
| 205 | + */ |
|
| 206 | 206 | protected function getVars($type, $key = null, $xss = true) { |
| 207 | 207 | $data = null; |
| 208 | 208 | if ($key === null) { |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | self::$logger = $logger[0]; |
| 45 | 45 | } |
| 46 | 46 | if ($setLoggerName) { |
| 47 | - self::$logger->setLogger('Class::' . get_called_class()); |
|
| 47 | + self::$logger->setLogger('Class::' . get_called_class()); |
|
| 48 | 48 | } |
| 49 | 49 | return self::$logger; |
| 50 | 50 | } |
@@ -189,11 +189,11 @@ |
||
| 189 | 189 | */ |
| 190 | 190 | define('VAR_PATH', ROOT_PATH . 'var' . DS); |
| 191 | 191 | |
| 192 | - /** |
|
| 193 | - * The path to the directory of your cache files. |
|
| 194 | - * |
|
| 195 | - * This feature is available currently for database and views. |
|
| 196 | - */ |
|
| 192 | + /** |
|
| 193 | + * The path to the directory of your cache files. |
|
| 194 | + * |
|
| 195 | + * This feature is available currently for database and views. |
|
| 196 | + */ |
|
| 197 | 197 | define('CACHE_PATH', VAR_PATH . 'cache' . DS); |
| 198 | 198 | |
| 199 | 199 | /** |
@@ -160,15 +160,15 @@ |
||
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
| 163 | - * Return the server port using variable |
|
| 164 | - * |
|
| 165 | - * @codeCoverageIgnore |
|
| 166 | - * @return string |
|
| 167 | - */ |
|
| 163 | + * Return the server port using variable |
|
| 164 | + * |
|
| 165 | + * @codeCoverageIgnore |
|
| 166 | + * @return string |
|
| 167 | + */ |
|
| 168 | 168 | protected static function getServerPort() { |
| 169 | 169 | $serverPort = 80; |
| 170 | 170 | if (isset($_SERVER['SERVER_PORT'])) { |
| 171 | - $serverPort = $_SERVER['SERVER_PORT']; |
|
| 171 | + $serverPort = $_SERVER['SERVER_PORT']; |
|
| 172 | 172 | } |
| 173 | 173 | $port = ''; |
| 174 | 174 | if ((is_https() && $serverPort != 443) || (!is_https() && $serverPort != 80)) { |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | } |
| 283 | 283 | $filename = $this->encodeUtf8($this->filterOther((string) $filename)); |
| 284 | 284 | if (empty($data)) { |
| 285 | - $data = $this->getAttachmentData($path); |
|
| 285 | + $data = $this->getAttachmentData($path); |
|
| 286 | 286 | } |
| 287 | 287 | $this->_attachments[] = array( |
| 288 | 288 | 'path' => $path, |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | $addresses = array(); |
| 347 | 347 | foreach ($pairs as $name => $email) { |
| 348 | 348 | if (is_numeric($name)) { |
| 349 | - $name = null; |
|
| 349 | + $name = null; |
|
| 350 | 350 | } |
| 351 | 351 | $addresses[] = $this->formatHeader($email, $name); |
| 352 | 352 | } |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | } else { |
| 182 | 182 | $logger->info('Cannot find view [' . $view . '] in module [' . $module . '] using the default location'); |
| 183 | 183 | } |
| 184 | - if (!$path) { |
|
| 184 | + if (!$path) { |
|
| 185 | 185 | $path = $this->getDefaultFilePathForView($viewFile); |
| 186 | 186 | } |
| 187 | 187 | $logger->info('The view file path to be loaded is [' . $path . ']'); |
@@ -336,12 +336,12 @@ discard block |
||
| 336 | 336 | } |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | - /** |
|
| 340 | - * Return the default full file path for view |
|
| 341 | - * @param string $file the filename |
|
| 342 | - * |
|
| 343 | - * @return string|null the full file path |
|
| 344 | - */ |
|
| 339 | + /** |
|
| 340 | + * Return the default full file path for view |
|
| 341 | + * @param string $file the filename |
|
| 342 | + * |
|
| 343 | + * @return string|null the full file path |
|
| 344 | + */ |
|
| 345 | 345 | protected static function getDefaultFilePathForView($file){ |
| 346 | 346 | $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH); |
| 347 | 347 | $fullFilePath = null; |
@@ -530,18 +530,18 @@ discard block |
||
| 530 | 530 | } |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | - /** |
|
| 534 | - * Set the mandory headers, like security, etc. |
|
| 535 | - */ |
|
| 533 | + /** |
|
| 534 | + * Set the mandory headers, like security, etc. |
|
| 535 | + */ |
|
| 536 | 536 | protected static function setRequiredHeaders() { |
| 537 | 537 | $requiredHeaders = array( |
| 538 | 538 | 'X-XSS-Protection' => '1; mode=block', |
| 539 | 539 | 'X-Frame-Options' => 'SAMEORIGIN' |
| 540 | 540 | ); |
| 541 | 541 | foreach ($requiredHeaders as $key => $value) { |
| 542 | - if (!isset(self::$headers[$key])) { |
|
| 542 | + if (!isset(self::$headers[$key])) { |
|
| 543 | 543 | self::$headers[$key] = $value; |
| 544 | - } |
|
| 544 | + } |
|
| 545 | 545 | } |
| 546 | 546 | } |
| 547 | 547 | } |
@@ -342,7 +342,7 @@ |
||
| 342 | 342 | * |
| 343 | 343 | * @return string|null the full file path |
| 344 | 344 | */ |
| 345 | - protected static function getDefaultFilePathForView($file){ |
|
| 345 | + protected static function getDefaultFilePathForView($file) { |
|
| 346 | 346 | $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH); |
| 347 | 347 | $fullFilePath = null; |
| 348 | 348 | foreach ($searchDir as $dir) { |
@@ -66,8 +66,8 @@ discard block |
||
| 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.'); |
|
| 70 | - return $this; |
|
| 69 | + $logger->info('The module [' .$name. '] already added skipping.'); |
|
| 70 | + return $this; |
|
| 71 | 71 | } |
| 72 | 72 | self::$list[] = $name; |
| 73 | 73 | return $this; |
@@ -97,10 +97,10 @@ discard block |
||
| 97 | 97 | self::$list = array(); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - /** |
|
| 101 | - * Get the list of module loaded |
|
| 102 | - * @return array the module list |
|
| 103 | - */ |
|
| 100 | + /** |
|
| 101 | + * Get the list of module loaded |
|
| 102 | + * @return array the module list |
|
| 103 | + */ |
|
| 104 | 104 | public static function getModuleList() { |
| 105 | 105 | return self::$list; |
| 106 | 106 | } |
@@ -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; |