Conditions | 5 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
46 | public function isLogged() |
||
47 | { |
||
48 | if (!isset($_SESSION['ga_cookie'])) { |
||
49 | return false; |
||
50 | } |
||
51 | |||
52 | foreach ($this->users as $user) { |
||
53 | if (password_verify($user['login'], $_SESSION['ga_cookie']) |
||
54 | && $_SESSION['egzaminer_auth_un'] === $user['login']) { |
||
55 | return true; |
||
56 | } |
||
57 | } |
||
58 | |||
59 | return false; |
||
60 | } |
||
61 | |||
75 |
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: