| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 105 | public static function validateAppsKeys(string $clientId, string $clientSecretId, int $appsId) : self |
||
| 106 | { |
||
| 107 | $appkeys = AppsKeys::findFirst([ |
||
| 108 | 'conditions' => 'client_id = ?0 and client_secret_id = ?1 and apps_id = ?2 and is_deleted = 0', |
||
| 109 | 'bind' => [ |
||
| 110 | $clientId, |
||
| 111 | $clientSecretId, |
||
| 112 | $appsId |
||
| 113 | ] |
||
| 114 | ]); |
||
| 115 | |||
| 116 | if (!$appkeys) { |
||
| 117 | throw new UnauthorizedException('Wrong Client Id or Client Secret Id given'); |
||
| 118 | } |
||
| 119 | |||
| 120 | $appkeys->last_used_date = date('Y-m-d H:i:s'); |
||
| 121 | $appkeys->updateOrFail(); |
||
| 122 | |||
| 123 | return $appkeys; |
||
| 124 | } |
||
| 126 |