| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function setAccessToken($oauthToken, $clientId, $userId, $expires, $scope = null) |
||
| 21 | { |
||
| 22 | $model = Yii::$container->get('user_credentials'); |
||
| 23 | $user = $model::findIdentity($userId); |
||
| 24 | $value = [ |
||
| 25 | 'access_token' => $oauthToken, |
||
| 26 | 'client_id' => $clientId, |
||
| 27 | 'user_id' => $userId, |
||
| 28 | 'expires' => $expires, |
||
| 29 | 'scope' => null, |
||
| 30 | 'union_id' => $user->getUnionId() |
||
| 31 | ]; |
||
| 32 | Predis::getInstance()->getClient()->setToken($oauthToken, $value); |
||
| 33 | } |
||
| 34 | } |
||
| 35 |