| Conditions | 4 |
| Paths | 3 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function getClientEntity( |
||
| 16 | $clientIdentifier, |
||
| 17 | $grantType = null, |
||
| 18 | $clientSecret = null, |
||
| 19 | $mustValidateSecret = true |
||
| 20 | ): ?ClientEntityInterface { |
||
| 21 | $appClient = $this->appClientRepository->findActive($clientIdentifier); |
||
|
|
|||
| 22 | if ($appClient === null) { |
||
| 23 | return null; |
||
| 24 | } |
||
| 25 | if ($mustValidateSecret && !hash_equals($appClient->getSecret(), (string) $clientSecret)) { |
||
| 26 | return null; |
||
| 27 | } |
||
| 28 | $oauthClient = new OauthClient($clientIdentifier, $appClient->getName(), $appClient->getRedirect()); |
||
| 29 | |||
| 30 | return $oauthClient; |
||
| 31 | } |
||
| 32 | } |
||
| 33 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: