| 1 | <?php |
||
| 22 | abstract class AbstractAdapter implements AdapterInterface |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * |
||
| 26 | * Verifies a set of credentials against a storage backend. |
||
| 27 | * |
||
| 28 | * @param array $input Credential input. |
||
| 29 | * |
||
| 30 | * @return array An array of login data on success. |
||
| 31 | * |
||
| 32 | */ |
||
| 33 | abstract public function login(array $input); |
||
| 34 | |||
| 35 | /** |
||
| 36 | * |
||
| 37 | * Handle logout logic against the storage backend. |
||
| 38 | * |
||
| 39 | * @param Auth $auth The authentication obbject to be logged out. |
||
| 40 | * |
||
| 41 | * @param string $status The new authentication status after logout. |
||
| 42 | * |
||
| 43 | * @return null |
||
| 44 | * |
||
| 45 | * @see Status |
||
| 46 | * |
||
| 47 | */ |
||
| 48 | 3 | public function logout(Auth $auth, $status = Status::ANON) |
|
| 49 | { |
||
| 50 | // do nothing |
||
| 51 | 3 | } |
|
| 52 | |||
| 53 | /** |
||
| 54 | * |
||
| 55 | * Handle a resumed session against the storage backend. |
||
| 56 | * |
||
| 57 | * @param Auth $auth The authentication object to be resumed. |
||
| 58 | * |
||
| 59 | * @return null |
||
| 60 | * |
||
| 61 | */ |
||
| 62 | 2 | public function resume(Auth $auth) |
|
| 66 | |||
| 67 | /** |
||
| 68 | * |
||
| 69 | * Check the credential input for completeness. |
||
| 70 | * |
||
| 71 | * @param array $input |
||
| 72 | * |
||
| 73 | * @return bool |
||
| 74 | * |
||
| 75 | */ |
||
| 76 | 18 | protected function checkInput($input) |
|
| 86 | } |
||
| 87 |