Conditions | 4 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public function __construct(User $user, callable $credentialsValidator = null) |
||
28 | { |
||
29 | $this->user = $user; |
||
30 | $this->credentialsValidator = $credentialsValidator ?: function () { |
||
31 | $this->user->logout(true); |
||
32 | try { |
||
33 | $this->user->login(...func_get_args()); |
||
34 | |||
35 | } catch (\Exception $e) {} // Fail silently |
||
36 | |||
37 | return $this->user->isLoggedIn() ? new UserEntity($this->user->getId()) : null; |
||
38 | }; |
||
39 | } |
||
40 | |||
58 |