88
99class ExternalBaseUserProvider implements UserProvider
1010{
11- /**
12- * The user model.
13- *
14- * @var string
15- */
16- protected $ model ;
17-
18- /**
19- * LdapUserProvider constructor.
20- */
21- public function __construct (string $ model )
22- {
23- $ this ->model = $ model ;
11+ public function __construct (
12+ protected string $ model
13+ ) {
2414 }
2515
2616 /**
2717 * Create a new instance of the model.
28- *
29- * @return Model
3018 */
31- public function createModel ()
19+ public function createModel (): Model
3220 {
3321 $ class = '\\' . ltrim ($ this ->model , '\\' );
3422
@@ -37,25 +25,18 @@ public function createModel()
3725
3826 /**
3927 * Retrieve a user by their unique identifier.
40- *
41- * @param mixed $identifier
42- *
43- * @return Authenticatable|null
4428 */
45- public function retrieveById ($ identifier )
29+ public function retrieveById (mixed $ identifier ): ? Authenticatable
4630 {
4731 return $ this ->createModel ()->newQuery ()->find ($ identifier );
4832 }
4933
5034 /**
5135 * Retrieve a user by their unique identifier and "remember me" token.
5236 *
53- * @param mixed $identifier
5437 * @param string $token
55- *
56- * @return Authenticatable|null
5738 */
58- public function retrieveByToken ($ identifier , $ token )
39+ public function retrieveByToken (mixed $ identifier , $ token ): null
5940 {
6041 return null ;
6142 }
@@ -75,12 +56,8 @@ public function updateRememberToken(Authenticatable $user, $token)
7556
7657 /**
7758 * Retrieve a user by the given credentials.
78- *
79- * @param array $credentials
80- *
81- * @return Authenticatable|null
8259 */
83- public function retrieveByCredentials (array $ credentials )
60+ public function retrieveByCredentials (array $ credentials ): ? Authenticatable
8461 {
8562 // Search current user base by looking up a uid
8663 $ model = $ this ->createModel ();
@@ -92,15 +69,15 @@ public function retrieveByCredentials(array $credentials)
9269
9370 /**
9471 * Validate a user against the given credentials.
95- *
96- * @param Authenticatable $user
97- * @param array $credentials
98- *
99- * @return bool
10072 */
101- public function validateCredentials (Authenticatable $ user , array $ credentials )
73+ public function validateCredentials (Authenticatable $ user , array $ credentials ): bool
10274 {
10375 // Should be done in the guard.
10476 return false ;
10577 }
78+
79+ public function rehashPasswordIfRequired (Authenticatable $ user , #[\SensitiveParameter] array $ credentials , bool $ force = false )
80+ {
81+ // No action to perform, any passwords are external in the auth system
82+ }
10683}
0 commit comments