Completed
Push — master ( 679073...d8b64b )
by Charles
01:52
created
api/actions/ChangeEmailAction.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use app\forms\ChangeEmail;
6 6
 use yrc\rest\Action as RestAction;
7
-
8 7
 use yii\web\HttpException;
9 8
 use Yii;
10 9
 
Please login to merge, or discard this patch.
api/actions/RegisterAction.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use app\forms\Registration;
6 6
 use yrc\rest\Action as RestAction;
7
-
8 7
 use yii\web\HttpException;
9 8
 use Yii;
10 9
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 {
17 17
     /**
18 18
      * Handles registration of users
19
-     * @return mixed
19
+     * @return boolean
20 20
      */
21 21
     public function post($params)
22 22
     {
Please login to merge, or discard this patch.
rest/Action.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -3,10 +3,7 @@
 block discarded – undo
3 3
 namespace yrc\rest;
4 4
 
5 5
 use yii\web\HttpException;
6
-use yii\helpers\ArrayHelper;
7 6
 use Yii;
8
-use ReflectionProperty;
9
-use ReflectionClass;
10 7
 
11 8
 abstract class Action extends \yii\base\Action
12 9
 {
Please login to merge, or discard this patch.
rest/Controller.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -9,9 +9,7 @@
 block discarded – undo
9 9
 use yii\filters\ContentNegotiator;
10 10
 use yii\web\HttpException;
11 11
 use yrc\web\Response;
12
-
13 12
 use Yii;
14
-
15 13
 use ReflectionClass;
16 14
 use ReflectionMethod;
17 15
 
Please login to merge, or discard this patch.
api/actions/OneTimeKeyAction.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use yrc\rest\Action as RestAction;
6 6
 use yrc\api\models\EncryptionKey;
7
-use Sodium;
8
-use Yii;
9 7
 
10 8
 class OneTimeKeyAction extends RestAction
11 9
 {
Please login to merge, or discard this patch.
api/actions/RefreshAction.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use yrc\api\actions\AuthenticationAction;
6 6
 use app\models\Token;
7
-use yrc\api\models\TokenKeyPair;
8
-use yrc\web\Json25519Parser;
9 7
 use yrc\rest\Action as RestAction;
10 8
 use yii\helpers\ArrayHelper;
11 9
 use Yii;
Please login to merge, or discard this patch.
api/models/Token.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace yrc\api\models;
4 4
 
5 5
 use Base32\Base32;
6
-use yrc\api\models\TokenKeyPair;
7 6
 use Yii;
8 7
 
9 8
 /**
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     }
46 46
 
47 47
     /**
48
-     * @return sodium_crypto_sign_publickey
48
+     * @return string
49 49
      */
50 50
     public function getSignPublicKey()
51 51
     {
@@ -55,8 +55,7 @@  discard block
 block discarded – undo
55 55
     /**
56 56
      * Generates a new auth and refresh token pair
57 57
      * @param int $userId
58
-     * @param bool $pubkey
59
-     * @return array
58
+     * @return Token
60 59
      */
61 60
     public static function generate($userId = null)
62 61
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
         $token->user_id = $userId;
73 73
         $token->access_token = \str_replace('=', '', Base32::encode(\random_bytes(32)));
74 74
         $token->refresh_token = \str_replace('=', '', Base32::encode(\random_bytes(32)));
75
-        $token->ikm =  \base64_encode(\random_bytes(32));
75
+        $token->ikm = \base64_encode(\random_bytes(32));
76 76
         $token->secret_sign_kp = \base64_encode(sodium_crypto_sign_secretkey($signKp));
77 77
         $token->expires_at = \strtotime(static::TOKEN_EXPIRATION_TIME);
78 78
 
Please login to merge, or discard this patch.
web/Json25519ResponseFormatter.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,6 @@
 block discarded – undo
7 7
 use yrc\web\Json25519Parser;
8 8
 use yrc\api\models\EncryptionKey;
9 9
 use yii\web\HttpException;
10
-
11 10
 use Yii;
12 11
 
13 12
 class Json25519ResponseFormatter extends JsonResponseFormatter
Please login to merge, or discard this patch.
web/JsonResponseFormatter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
                 $response->data['status'] = $status;
60 60
 
61 61
                 if ($response->data['data'] === [] || $response->data['data'] === null) {
62
-                    $response->data['data'] =  null;
62
+                    $response->data['data'] = null;
63 63
                 }
64 64
             }
65 65
 
Please login to merge, or discard this patch.