File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -198,24 +198,22 @@ public function getPasswordSalt(string $method): ?string
198198
199199 /**
200200 * Determine the password hash method to use from the users current password.
201- *
202- * @return string|void
203201 */
204- public function determinePasswordHashMethod ()
202+ public function determinePasswordHashMethod (): ? string
205203 {
206204 if (! $ password = $ this ->password ) {
207- return ;
205+ return null ;
208206 }
209207
210208 if (! $ method = Password::getHashMethod ($ password )) {
211- return ;
209+ return null ;
212210 }
213211
214- [, $ algo ] = array_pad (
215- Password:: getHashMethodAndAlgo ( $ password ) ?? [],
216- $ length = 2 ,
217- $ value = null
218- );
212+ if (! $ hashAndAlgo = Password:: getHashMethodAndAlgo ( $ password )) {
213+ return $ method ;
214+ }
215+
216+ [, $ algo ] = array_pad (array: $ hashAndAlgo , length: 2 , value: null );
219217
220218 return match ((int ) $ algo ) {
221219 Password::CRYPT_SALT_TYPE_MD5 => 'md5 ' .$ method ,
You can’t perform that action at this time.
0 commit comments