@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | /** |
| 57 | 57 | * Get current authenticated user id |
| 58 | 58 | * |
| 59 | - * @return mixed |
|
| 59 | + * @return integer |
|
| 60 | 60 | */ |
| 61 | 61 | protected static function getCurrentUserId() |
| 62 | 62 | { |
@@ -79,7 +79,9 @@ discard block |
||
| 79 | 79 | /** |
| 80 | 80 | * Fetch user and verify password |
| 81 | 81 | * |
| 82 | - * @return User|false |
|
| 82 | + * @param string $username |
|
| 83 | + * @param string $password |
|
| 84 | + * @return User |
|
| 83 | 85 | */ |
| 84 | 86 | public static function verify($username, $password) |
| 85 | 87 | { |
@@ -94,7 +96,7 @@ discard block |
||
| 94 | 96 | * |
| 95 | 97 | * @param string $username |
| 96 | 98 | * @param string $password |
| 97 | - * @return boolean |
|
| 99 | + * @return null|boolean |
|
| 98 | 100 | */ |
| 99 | 101 | public static function login($username, $password) |
| 100 | 102 | { |
@@ -186,7 +188,7 @@ discard block |
||
| 186 | 188 | /** |
| 187 | 189 | * Generate a confirmation hash |
| 188 | 190 | * |
| 189 | - * @param User|int $user |
|
| 191 | + * @param string $user |
|
| 190 | 192 | * @return string |
| 191 | 193 | */ |
| 192 | 194 | public static function generateConfirmationHash($user) |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | { |
| 48 | 48 | // Black hole |
| 49 | 49 | trigger_error( |
| 50 | - "Method for remembering the current user isn't implemented. " . |
|
| 50 | + "Method for remembering the current user isn't implemented. ". |
|
| 51 | 51 | "You can use the Jasny\Auth\Sessions trait to store the current user in a session", |
| 52 | 52 | E_USER_NOTICE |
| 53 | 53 | ); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * @param string $password |
| 71 | 71 | * @param string $salt Use specific salt to verify existing password |
| 72 | 72 | */ |
| 73 | - public static function password($password, $salt=null) |
|
| 73 | + public static function password($password, $salt = null) |
|
| 74 | 74 | { |
| 75 | 75 | return isset($salt) ? crypt($password, $salt) : password_hash($password, PASSWORD_BCRYPT); |
| 76 | 76 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | { |
| 194 | 194 | $id = is_object($user) ? $user->getId() : $user; |
| 195 | 195 | |
| 196 | - return sprintf('%010s', substr(base_convert(md5($id . static::getSecret()), 16, 36), -10) . |
|
| 196 | + return sprintf('%010s', substr(base_convert(md5($id.static::getSecret()), 16, 36), -10). |
|
| 197 | 197 | base_convert($id, 10, 36)); |
| 198 | 198 | } |
| 199 | 199 | |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | $id = $user->getId(); |
| 223 | 223 | $password = $user->getPassword(); |
| 224 | 224 | |
| 225 | - return sprintf('%010s', substr(base_convert(md5($id . static::getSecret() . $password), 16, 36), -10) |
|
| 225 | + return sprintf('%010s', substr(base_convert(md5($id.static::getSecret().$password), 16, 36), -10) |
|
| 226 | 226 | . base_convert($id, 10, 36)); |
| 227 | 227 | } |
| 228 | 228 | |