| Total Complexity | 7 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class AuthUserProvider extends EloquentUserProvider |
||
| 13 | { |
||
| 14 | use CallableTrait; |
||
| 15 | |||
| 16 | public function retrieveByCredentials(array $credentials) |
||
| 17 | { |
||
| 18 | // First we will add each credential element to the query as a where clause. |
||
| 19 | // Then we can execute the query and, if we found a user, return it in a |
||
| 20 | // Eloquent User "model" that will be utilized by the Guard instances. |
||
| 21 | $query = $this->createModel()->newQuery(); |
||
| 22 | |||
| 23 | foreach ($credentials as $key => $value) { |
||
| 24 | if (!Str::contains($key, 'password')) { |
||
| 25 | // handle closures |
||
| 26 | $value = $this->retrieveValue($value); |
||
| 27 | |||
| 28 | $query = \call_user_func_array([$query, $this->searchMethod($value)], [$key, $value]); |
||
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | return $query->first(); |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param $value |
||
| 37 | * |
||
| 38 | * @return string |
||
| 39 | */ |
||
| 40 | protected function searchMethod($value) |
||
| 41 | { |
||
| 42 | return \is_array($value) ? 'whereIn' : 'where'; |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @param $value |
||
| 47 | * |
||
| 48 | * @return mixed |
||
| 49 | */ |
||
| 50 | protected function retrieveValue($value) |
||
| 57 | } |
||
| 58 | } |
||
| 59 |
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