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