| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 60 | 9 | public function getIdentity(): ?IdentityInterface |
|
| 61 | { |
||
| 62 | 9 | if (!$this->identity) { |
|
| 63 | // check user agent |
||
| 64 | 6 | if (Session::get('auth:agent') === Request::getServer('HTTP_USER_AGENT')) { |
|
| 65 | 5 | $this->identity = Session::get('auth:identity'); |
|
| 66 | } else { |
||
| 67 | 1 | $this->clearIdentity(); |
|
| 68 | } |
||
| 69 | } |
||
| 70 | 9 | return $this->identity; |
|
| 71 | } |
||
| 85 |