Completed
Push — master ( 4f3de5...9b9e7a )
by Pavel
05:51
created
app/src/Providers/EncoderServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@
 block discarded – undo
14 14
      */
15 15
     public function register(Container $container)
16 16
     {
17
-        $config  = $container['settings'];
17
+        $config = $container['settings'];
18 18
 
19
-        $container['encoder'] = function (Container $c) use ($config) {
19
+        $container['encoder'] = function(Container $c) use ($config) {
20 20
             $encoder = new JsonApiEncoder($config);
21 21
 
22 22
             return $encoder;
Please login to merge, or discard this patch.
app/src/Model/User.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
         return $this->hasOne('App\Model\Role', 'id', 'role_id');
67 67
     }
68 68
 
69
-    public function access_tokens(){
69
+    public function access_tokens() {
70 70
         return $this->hasMany('App\Model\AccessToken', 'user_id', 'id');
71 71
     }
72 72
 
73
-    public function refresh_tokens(){
73
+    public function refresh_tokens() {
74 74
         return $this->hasMany('App\Model\RefreshToken', 'user_id', 'id');
75 75
     }
76 76
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
             return false;
137 137
         }
138 138
 
139
-        $timestamp = (int) substr($token, strrpos($token, '_') + 1);
139
+        $timestamp = (int)substr($token, strrpos($token, '_') + 1);
140 140
         $expire    = 3600;
141 141
         return $timestamp + $expire >= time();
142 142
     }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      */
147 147
     public function generatePasswordResetToken()
148 148
     {
149
-        $this->password_reset_token = Helper::generateRandomString() . '_' . time();
149
+        $this->password_reset_token = Helper::generateRandomString().'_'.time();
150 150
     }
151 151
 
152 152
     /**
Please login to merge, or discard this patch.
app/src/Model/RefreshToken.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
     public $timestamps = false;
26 26
 
27
-    public function user(){
27
+    public function user() {
28 28
         return $this->belongsTo('App\Model\User');
29 29
     }
30 30
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public static function createRefreshToken(User $user)
54 54
     {
55
-        $refreshToken = md5(Helper::generateRandomString() . '_' . time());
55
+        $refreshToken = md5(Helper::generateRandomString().'_'.time());
56 56
 
57 57
         $user->refresh_tokens()->create([
58 58
             'refresh_token' => $refreshToken,
Please login to merge, or discard this patch.
app/src/Model/AccessToken.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
     public $timestamps = false;
26 26
 
27
-    public function user(){
27
+    public function user() {
28 28
         return $this->belongsTo('App\Model\User');
29 29
     }
30 30
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         try {
57 57
             $payload = JWT::decode($token, getenv('SECRET_KEY'), ['HS256']);
58 58
             return in_array($payload->aud, $whiteList);
59
-        } catch (\Exception $e){
59
+        } catch (\Exception $e) {
60 60
             return false;
61 61
         }
62 62
     }
Please login to merge, or discard this patch.
app/database/migrations/20170128112159_create_access_tokens_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 use Illuminate\Database\Capsule\Manager as Capsule;
3 3
 
4
-class CreateAccessTokensTable{
4
+class CreateAccessTokensTable {
5 5
     /**
6 6
     * Do the migration
7 7
     */
Please login to merge, or discard this patch.
app/database/migrations/20170129140408_create_refresh_tokens_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 use Illuminate\Database\Capsule\Manager as Capsule;
3 3
 
4
-class CreateRefreshTokensTable{
4
+class CreateRefreshTokensTable {
5 5
     /**
6 6
     * Do the migration
7 7
     */
Please login to merge, or discard this patch.