| Conditions | 3 |
| Paths | 4 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function persistNewAuthCode(AuthCodeEntityInterface $authCodeEntity) |
||
| 25 | { |
||
| 26 | $clientId = $authCodeEntity->getClient()->getIdentifier(); |
||
| 27 | [$userType, $userId] = explode(':', $authCodeEntity->getUserIdentifier()); |
||
| 28 | |||
| 29 | $userId = method_exists($user = app('cortex.auth.'.$userType), 'unhashId') ? $user->unhashId($userId) : $userId; |
||
| 30 | $clientId = method_exists($client = app('rinvex.oauth.client'), 'unhashId') ? $client->unhashId($clientId) : $clientId; |
||
| 31 | |||
| 32 | app('rinvex.oauth.auth_code')->create([ |
||
| 33 | 'identifier' => $authCodeEntity->getIdentifier(), |
||
| 34 | 'user_id' => $userId, |
||
| 35 | 'user_type' => $userType, |
||
| 36 | 'client_id' => $clientId, |
||
| 37 | 'is_revoked' => false, |
||
| 38 | 'expires_at' => $authCodeEntity->getExpiryDateTime(), |
||
| 39 | ]); |
||
| 40 | } |
||
| 41 | |||
| 58 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.