| Conditions | 5 |
| Paths | 7 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 36 | public function handle(OtherDeviceLogout $event) |
||
| 37 | { |
||
| 38 | if ($event->user) { |
||
| 39 | $currentUser = $event->user; |
||
| 40 | $currentUserIp = $this->request->ip(); |
||
| 41 | $currentUserAgent = $this->request->userAgent(); |
||
| 42 | $currentAuthLog = $currentUser->authentications()->whereIpAddress($currentUserIp)->whereUserAgent($currentUserAgent)->first(); |
||
| 43 | |||
| 44 | if (! $currentAuthLog) { |
||
| 45 | $currentAuthLog = new AuthenticationLog([ |
||
| 46 | 'ip_address' => $currentUserIp, |
||
| 47 | 'user_agent' => $currentUserAgent, |
||
| 48 | ]); |
||
| 49 | } |
||
| 50 | |||
| 51 | foreach ($currentUser->authentications as $authLog) { |
||
| 52 | if ($authLog->id != $currentAuthLog->id) { |
||
| 53 | $authLog->logout_at = Carbon::now(); |
||
| 54 | $authLog->save(); |
||
| 55 | } |
||
| 60 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths