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