| Conditions | 5 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 26 | public function getClientEntity( |
||
| 27 | $clientIdentifier, |
||
| 28 | $grantType = null, |
||
| 29 | $clientSecret = null, |
||
| 30 | $mustValidateSecret = true |
||
| 31 | ) { |
||
| 32 | // First, we will verify that the client exists |
||
| 33 | $client = $this->findOneByIdentifier($clientIdentifier); |
||
| 34 | |||
| 35 | if (!$client || !$client->handlesGrant($grantType)) { |
||
|
|
|||
| 36 | return; |
||
| 37 | } |
||
| 38 | |||
| 39 | if ($mustValidateSecret && !$client->validateSecret($clientSecret)) { |
||
| 40 | return; |
||
| 41 | } |
||
| 42 | return $client; |
||
| 43 | } |
||
| 62 |