Conditions | 3 |
Paths | 3 |
Total Lines | 20 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public static function post($params) |
||
|
|||
22 | { |
||
23 | // Get the token |
||
24 | $token = AuthenticationAction::getAccessTokenFromHeader(); |
||
25 | |||
26 | $refreshToken = Yii::$app->request->post('refresh_token', false); |
||
27 | |||
28 | if ($refreshToken !== $token->refreshToken) { |
||
29 | return false; |
||
30 | } |
||
31 | |||
32 | // If we can delete the token, send a newly generated token out |
||
33 | if ($token->delete()) { |
||
34 | $tokens = Token::generate(Yii::$app->user->id); |
||
35 | return $data; |
||
36 | } |
||
37 | |||
38 | // Return false for any other reasons |
||
39 | return false; |
||
40 | } |
||
41 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.