| 1 | <?php |
||
| 10 | class SessionLoginManager implements LoginManagerInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var AccountManagerInterface |
||
| 14 | */ |
||
| 15 | private $accountManager; |
||
| 16 | |||
| 17 | public function __construct(array $settings = []) |
||
| 25 | |||
| 26 | public function login($accountId, $password) |
||
| 39 | |||
| 40 | public function logout() |
||
| 44 | |||
| 45 | public function isLogged() |
||
| 49 | |||
| 50 | public function getLoggedAccountId() |
||
| 58 | } |
||
| 59 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: