@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * |
126 | 126 | * @param string $lang Language |
127 | 127 | * |
128 | - * @return bool |
|
128 | + * @return integer |
|
129 | 129 | */ |
130 | 130 | public static function isLanguage($lang) |
131 | 131 | { |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * |
138 | 138 | * @param int $date Date |
139 | 139 | * |
140 | - * @return int |
|
140 | + * @return boolean |
|
141 | 141 | */ |
142 | 142 | public static function isLikeOnPMFDate($date) |
143 | 143 | { |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | /** |
347 | 347 | * debug_backtrace() wrapper function. |
348 | 348 | * |
349 | - * @param $string |
|
349 | + * @param string $string |
|
350 | 350 | * |
351 | 351 | * @return string |
352 | 352 | */ |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | |
408 | 408 | /** |
409 | 409 | * Creates a seed with microseconds. |
410 | - * @return float|int |
|
410 | + * @return integer|null |
|
411 | 411 | */ |
412 | 412 | private static function makeSeed() |
413 | 413 | { |
@@ -417,8 +417,8 @@ discard block |
||
417 | 417 | |
418 | 418 | /** |
419 | 419 | * Returns a random number. |
420 | - * @param $min |
|
421 | - * @param $max |
|
420 | + * @param integer $min |
|
421 | + * @param integer $max |
|
422 | 422 | * @return int |
423 | 423 | */ |
424 | 424 | public static function createRandomNumber($min, $max) |
@@ -412,7 +412,7 @@ |
||
412 | 412 | private static function makeSeed() |
413 | 413 | { |
414 | 414 | list($usec, $sec) = explode(' ', microtime()); |
415 | - return $sec + $usec * 1000000; |
|
415 | + return $sec + $usec*1000000; |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | /** |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | public function getUserId() |
244 | 244 | { |
245 | 245 | if (isset($this->userId) && is_int($this->userId)) { |
246 | - return (int) $this->userId; |
|
246 | + return (int)$this->userId; |
|
247 | 247 | } |
248 | 248 | $this->userId = -1; |
249 | 249 | $this->errors[] = self::ERROR_USER_NO_USERID; |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | WHERE |
273 | 273 | user_id = %d '.($allowBlockedUsers ? '' : "AND account_status != 'blocked'"), |
274 | 274 | PMF_Db::getTablePrefix(), |
275 | - (int) $userId |
|
275 | + (int)$userId |
|
276 | 276 | ); |
277 | 277 | |
278 | 278 | $res = $this->config->getDb()->query($select); |
@@ -282,9 +282,9 @@ discard block |
||
282 | 282 | return false; |
283 | 283 | } |
284 | 284 | $user = $this->config->getDb()->fetchArray($res); |
285 | - $this->userId = (int) $user['user_id']; |
|
286 | - $this->login = (string) $user['login']; |
|
287 | - $this->status = (string) $user['account_status']; |
|
285 | + $this->userId = (int)$user['user_id']; |
|
286 | + $this->login = (string)$user['login']; |
|
287 | + $this->status = (string)$user['account_status']; |
|
288 | 288 | |
289 | 289 | // get encrypted password |
290 | 290 | // @todo: Add a getEncPassword method to the Auth* classes for the (local and remote) Auth Sources. |
@@ -349,9 +349,9 @@ discard block |
||
349 | 349 | return false; |
350 | 350 | } |
351 | 351 | $user = $this->config->getDb()->fetchArray($res); |
352 | - $this->userId = (int) $user['user_id']; |
|
353 | - $this->login = (string) $user['login']; |
|
354 | - $this->status = (string) $user['account_status']; |
|
352 | + $this->userId = (int)$user['user_id']; |
|
353 | + $this->login = (string)$user['login']; |
|
354 | + $this->status = (string)$user['account_status']; |
|
355 | 355 | |
356 | 356 | // get user-data |
357 | 357 | if (!$this->userdata instanceof PMF_User_UserData) { |
@@ -398,9 +398,9 @@ discard block |
||
398 | 398 | return false; |
399 | 399 | } |
400 | 400 | |
401 | - $this->userId = (int) $user['user_id']; |
|
402 | - $this->login = (string) $user['login']; |
|
403 | - $this->status = (string) $user['account_status']; |
|
401 | + $this->userId = (int)$user['user_id']; |
|
402 | + $this->login = (string)$user['login']; |
|
403 | + $this->status = (string)$user['account_status']; |
|
404 | 404 | |
405 | 405 | // get user-data |
406 | 406 | if (!$this->userdata instanceof PMF_User_UserData) { |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | } |
505 | 505 | |
506 | 506 | // is $login valid? |
507 | - $login = (string) $login; |
|
507 | + $login = (string)$login; |
|
508 | 508 | if (!$this->isValidLogin($login)) { |
509 | 509 | $this->errors[] = self::ERROR_USER_LOGINNAME_TOO_SHORT; |
510 | 510 | |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | |
521 | 521 | // set user-ID |
522 | 522 | if (0 == $userId) { |
523 | - $this->userId = (int) $this->config->getDb()->nextId(PMF_Db::getTablePrefix().'faquser', 'user_id'); |
|
523 | + $this->userId = (int)$this->config->getDb()->nextId(PMF_Db::getTablePrefix().'faquser', 'user_id'); |
|
524 | 524 | } else { |
525 | 525 | $this->userId = $userId; |
526 | 526 | } |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | */ |
777 | 777 | public function isValidLogin($login) |
778 | 778 | { |
779 | - $login = (string) $login; |
|
779 | + $login = (string)$login; |
|
780 | 780 | |
781 | 781 | if (strlen($login) < $this->loginMinLength || !preg_match($this->validUsername, $login)) { |
782 | 782 | $this->errors[] = self::ERROR_USER_LOGIN_INVALID; |
@@ -1058,8 +1058,8 @@ discard block |
||
1058 | 1058 | // To make passwords harder to get wrong, a few letters & numbers have been omitted. |
1059 | 1059 | // This will ensure safety with browsers using fonts with confusable letters. |
1060 | 1060 | // Removed: o,O,0,1,l,L |
1061 | - $consonants = ['b','c','d','f','g','h','j','k','m','n','p','r','s','t','v','w','x','y','z']; |
|
1062 | - $vowels = ['a','e','i','u']; |
|
1061 | + $consonants = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'm', 'n', 'p', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z']; |
|
1062 | + $vowels = ['a', 'e', 'i', 'u']; |
|
1063 | 1063 | $newPassword = ''; |
1064 | 1064 | $skipped = false; |
1065 | 1065 | |
@@ -1071,9 +1071,7 @@ discard block |
||
1071 | 1071 | } |
1072 | 1072 | |
1073 | 1073 | switch (rand(0, $skipped ? 3 : ($allowUnderscore ? 5 : 4))) { |
1074 | - case 0: |
|
1075 | - case 1: |
|
1076 | - $nextChar = $caseFunc($consonants[rand(0, 18)]); |
|
1074 | + case 0 : case 1 : $nextChar = $caseFunc($consonants[rand(0, 18)]); |
|
1077 | 1075 | break; |
1078 | 1076 | case 2: |
1079 | 1077 | case 3: |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | $mail->message = html_entity_decode( |
436 | 436 | $PMF_LANG['msgMailCheck'])."\n\n". |
437 | 437 | $faqConfig->get('main.titleFAQ').': '. |
438 | - $faqConfig->getDefaultUrl().'admin/?action=editentry&id=' . $recordId; |
|
438 | + $faqConfig->getDefaultUrl().'admin/?action=editentry&id='.$recordId; |
|
439 | 439 | $result = $mail->send(); |
440 | 440 | unset($mail); |
441 | 441 | |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | $votingData = array( |
695 | 695 | 'record_id' => $recordId, |
696 | 696 | 'vote' => $vote, |
697 | - 'user_ip' => $userIp, ); |
|
697 | + 'user_ip' => $userIp,); |
|
698 | 698 | |
699 | 699 | if (!$faq->getNumberOfVotings($recordId)) { |
700 | 700 | $faq->addVoting($votingData); |
@@ -832,7 +832,7 @@ discard block |
||
832 | 832 | |
833 | 833 | $userData = array( |
834 | 834 | 'display_name' => $name, |
835 | - 'email' => $email, ); |
|
835 | + 'email' => $email,); |
|
836 | 836 | $success = $user->setUserData($userData); |
837 | 837 | |
838 | 838 | if (0 !== strlen($password) && 0 !== strlen($confirm)) { |
@@ -867,10 +867,10 @@ discard block |
||
867 | 867 | |
868 | 868 | if ($loginExist && ($email == $user->getUserData('email'))) { |
869 | 869 | $consonants = array( |
870 | - 'b','c','d','f','g','h','j','k','l','m','n','p','r','s','t','v','w','x','y','z', |
|
870 | + 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z', |
|
871 | 871 | ); |
872 | 872 | $vowels = array( |
873 | - 'a','e','i','o','u', |
|
873 | + 'a', 'e', 'i', 'o', 'u', |
|
874 | 874 | ); |
875 | 875 | $newPassword = ''; |
876 | 876 | for ($i = 1; $i <= 4; ++$i) { |