Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2.0185 |
Changes | 0 |
1 | <?php |
||
41 | 3 | public function setIdentity(IdentityInterface $identity): void |
|
42 | { |
||
43 | // save identity to Auth |
||
44 | 3 | $this->identity = $identity; |
|
45 | // regenerate session |
||
46 | 3 | if (PHP_SAPI !== 'cli') { |
|
47 | Session::regenerateId(); |
||
48 | } |
||
49 | // save identity to session |
||
50 | 3 | Session::set('auth:identity', $identity); |
|
51 | // save user agent to session |
||
52 | 3 | Session::set('auth:agent', Request::getServer('HTTP_USER_AGENT')); |
|
53 | 3 | } |
|
85 |