Passed
Push — main ( a6f4a7...c388bf )
by Garbuz
02:41
created
src/Repositories/AccessTokenRepository.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public function deleteAccessTokenById(int $token_id): bool
52 52
     {
53
-        return (bool)AccessToken::where('id', $token_id)->delete();
53
+        return (bool) AccessToken::where('id', $token_id)->delete();
54 54
     }
55 55
 
56 56
     /**
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function deleteAccessToken(string $token): bool
64 64
     {
65
-        return (bool)AccessToken::where('token', $token)->delete();
65
+        return (bool) AccessToken::where('token', $token)->delete();
66 66
     }
67 67
 
68 68
     /**
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      */
76 76
     public function deleteAccessTokenByUser(int $user_id, string $user_type): bool
77 77
     {
78
-        return (bool)AccessToken::where('user_id', $user_id)->where('user_type', $user_type)->delete();
78
+        return (bool) AccessToken::where('user_id', $user_id)->where('user_type', $user_type)->delete();
79 79
     }
80 80
 
81 81
     /**
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      */
99 99
     public function deactivationAccessTokenById(int $token_id): bool
100 100
     {
101
-        return (bool)AccessToken::where('id', $token_id)->update([
101
+        return (bool) AccessToken::where('id', $token_id)->update([
102 102
             'expiration' => Carbon::now()->subMinutes(),
103 103
         ]);
104 104
     }
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      */
113 113
     public function deactivationAccessToken(string $token): bool
114 114
     {
115
-        return (bool)AccessToken::where('token', $token)->update([
115
+        return (bool) AccessToken::where('token', $token)->update([
116 116
             'expiration' => Carbon::now()->subMinutes(),
117 117
         ]);
118 118
     }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      */
128 128
     public function deactivationAccessTokenByUser(int $user_id, string $user_type): bool
129 129
     {
130
-        return (bool)AccessToken::where('user_id', $user_id)
130
+        return (bool) AccessToken::where('user_id', $user_id)
131 131
             ->where('user_type', $user_type)
132 132
             ->update([
133 133
                 'expiration' => Carbon::now()->subMinutes(),
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
      */
145 145
     public function prolongationAccessTokenById(int $token_id, DateTime $expiration): bool
146 146
     {
147
-        return (bool)AccessToken::where('id', $token_id)->update(['expiration' => $expiration]);
147
+        return (bool) AccessToken::where('id', $token_id)->update(['expiration' => $expiration]);
148 148
     }
149 149
 
150 150
     /**
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      */
158 158
     public function prolongationAccessToken(string $token, DateTime $expiration): bool
159 159
     {
160
-        return (bool)AccessToken::where('token', $token)->update(['expiration' => $expiration]);
160
+        return (bool) AccessToken::where('token', $token)->update(['expiration' => $expiration]);
161 161
     }
162 162
 
163 163
     /**
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
      */
172 172
     public function prolongationAccessTokenByUser(int $user_id, string $user_type, DateTime $expiration): bool
173 173
     {
174
-        return (bool)AccessToken::where('user_id', $user_id)
174
+        return (bool) AccessToken::where('user_id', $user_id)
175 175
             ->where('user_type', $user_type)
176 176
             ->update(['expiration' => $expiration]);
177 177
     }
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         string   $user_type,
197 197
         string   $token
198 198
     ): bool {
199
-        return (bool)AccessToken::where('id', $token_id)->update([
199
+        return (bool) AccessToken::where('id', $token_id)->update([
200 200
             'token'      => $token,
201 201
             'user_id'    => $user_id,
202 202
             'user_type'  => $user_type,
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
      */
254 254
     public function setLastUseAccessToken(string $token): bool
255 255
     {
256
-        return (bool)AccessToken::where('token', $token)->update([
256
+        return (bool) AccessToken::where('token', $token)->update([
257 257
             'last_use' => Carbon::now()->subMinutes(),
258 258
         ]);
259 259
     }
Please login to merge, or discard this patch.
src/Config.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -71,13 +71,13 @@
 block discarded – undo
71 71
      */
72 72
     public function load(): Config
73 73
     {
74
-        $this->encryption = (bool)config($this->configName . '.encryption', $this->encryption);
75
-        $this->autoClear = (bool)config($this->configName . '.auto_clear', $this->autoClear);
74
+        $this->encryption = (bool) config($this->configName . '.encryption', $this->encryption);
75
+        $this->autoClear = (bool) config($this->configName . '.auto_clear', $this->autoClear);
76 76
         $this->autoClearPause = intval(config($this->configName . '.auto_clear_pause', $this->autoClearPause));
77
-        $this->repository = (string)config($this->configName . '.repository', $this->repository);
78
-        $this->lastUse = (bool)config($this->configName . '.last_use', $this->lastUse);
79
-        $this->jwt = (bool)config($this->configName . '.jwt', $this->jwt);
80
-        $this->salt = (string)config($this->configName . '.salt', $this->salt);
77
+        $this->repository = (string) config($this->configName . '.repository', $this->repository);
78
+        $this->lastUse = (bool) config($this->configName . '.last_use', $this->lastUse);
79
+        $this->jwt = (bool) config($this->configName . '.jwt', $this->jwt);
80
+        $this->salt = (string) config($this->configName . '.salt', $this->salt);
81 81
         $this->salt = file_exists($this->salt) ? file_get_contents($this->salt) : $this->salt;
82 82
         return $this;
83 83
     }
Please login to merge, or discard this patch.
src/ServiceProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,14 +59,14 @@
 block discarded – undo
59 59
      */
60 60
     public function register()
61 61
     {
62
-        $this->app->singleton(Config::class, function () {
62
+        $this->app->singleton(Config::class, function() {
63 63
             return new Config;
64 64
         });
65
-        $this->app->singleton(AccessTokenRepository::class, function () {
65
+        $this->app->singleton(AccessTokenRepository::class, function() {
66 66
             return new AccessTokenRepository;
67 67
         });
68 68
         $this->app->bind(AccessTokenRepositoryInterface::class, app(Config::class)->getRepository());
69
-        $this->app->singleton(TokenManager::class, function () {
69
+        $this->app->singleton(TokenManager::class, function() {
70 70
             return new TokenManager(app(Config::class), app(AccessTokenRepositoryInterface::class));
71 71
         });
72 72
     }
Please login to merge, or discard this patch.