| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4.432 |
| Changes | 4 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 15 | public static function resolve() |
||
| 16 | 15 | { |
|
| 17 | 15 | $guards = Config::get('audit.user.guards', [ |
|
| 18 | 15 | Config::get('auth.defaults.guard') |
|
| 19 | ]); |
||
| 20 | 15 | ||
| 21 | foreach ($guards as $guard) { |
||
| 22 | 15 | try { |
|
| 23 | $authenticated = Auth::guard($guard)->check(); |
||
| 24 | } catch (\Exception $exception) { |
||
| 25 | continue; |
||
| 26 | } |
||
| 27 | 15 | ||
| 28 | if (true === $authenticated) { |
||
| 29 | return Auth::guard($guard)->user(); |
||
| 30 | } |
||
| 31 | } |
||
| 32 | 15 | ||
| 33 | return null; |
||
| 34 | } |
||
| 36 |