1 | <?php |
||
10 | class OAuthUserProvider implements UserProvider |
||
11 | { |
||
12 | /** |
||
13 | * The user provider instance. |
||
14 | * |
||
15 | * @var \Illuminate\Contracts\Auth\UserProvider |
||
16 | */ |
||
17 | protected $provider; |
||
18 | |||
19 | /** |
||
20 | * The user provider name. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $userType; |
||
25 | |||
26 | /** |
||
27 | * Create a new user provider. |
||
28 | * |
||
29 | * @param \Illuminate\Contracts\Auth\UserProvider $provider |
||
30 | * @param string $userType |
||
31 | * |
||
32 | * @return void |
||
|
|||
33 | */ |
||
34 | public function __construct(UserProvider $provider, $userType) |
||
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | public function retrieveById($identifier) |
||
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | public function retrieveByToken($identifier, $rememberToken) |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function updateRememberToken(Authenticatable $user, $rememberToken) |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function retrieveByCredentials(array $credentials) |
||
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | public function validateCredentials(Authenticatable $user, array $credentials) |
||
79 | |||
80 | /** |
||
81 | * Get the name of the user type. |
||
82 | * |
||
83 | * @return string |
||
84 | */ |
||
85 | public function getUserType() |
||
89 | } |
||
90 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.