| Conditions | 4 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 4.3731 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | 4 | public function getUserEntityByUserCredentials( |
|
| 20 | $username, |
||
| 21 | $password, |
||
| 22 | $grantType, |
||
| 23 | ClientEntityInterface $clientEntity |
||
| 24 | ) |
||
| 25 | { |
||
| 26 | 4 | $user = $this->findWhere([['username', '=', $username]]); |
|
| 27 | |||
| 28 | 4 | if (!$user || !($user = $user->first())) { |
|
| 29 | return null; |
||
| 30 | } |
||
| 31 | |||
| 32 | 4 | if (!Hash::check($password, $user->password)) { |
|
| 33 | return null; |
||
| 34 | } |
||
| 35 | |||
| 36 | 4 | return $user; |
|
| 37 | } |
||
| 38 | |||
| 40 |