| Conditions | 8 |
| Paths | 20 |
| Total Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | private function executeAuthMethod($method) |
||
| 29 | { |
||
| 30 | $guards = $this->config->get('authentication_guards'); |
||
| 31 | // Make sure authentication_guards at least contains a null value to DRY code |
||
| 32 | if (empty($guards)) { |
||
| 33 | $guards[] = null; |
||
| 34 | } |
||
| 35 | |||
| 36 | foreach ($this->getAuthentication() as $auth) { |
||
| 37 | foreach ($guards as $guard) { |
||
| 38 | // Call guard() if not null |
||
| 39 | if ($guard && $guard != 'null') { |
||
| 40 | $auth = $auth->guard($guard); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | if (is_callable([$auth, $method], true, $callable_name)) { |
||
| 44 | if ($data = $auth->$method()) { |
||
| 45 | return $data; |
||
| 46 | } |
||
| 47 | } |
||
| 48 | } |
||
| 49 | |||
| 50 | return false; |
||
| 51 | } |
||
| 52 | |||
| 74 |