Passed
Push — main ( c388bf...5a9537 )
by Garbuz
02:50
created
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.
src/Repositories/AccessTokenRepository.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      */
52 52
     public function deleteAccessTokenById(int $token_id): bool
53 53
     {
54
-        return (bool)AccessToken::where('id', $token_id)->delete();
54
+        return (bool) AccessToken::where('id', $token_id)->delete();
55 55
     }
56 56
 
57 57
     /**
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function deleteAccessToken(string $token): bool
65 65
     {
66
-        return (bool)AccessToken::where('token', $token)->delete();
66
+        return (bool) AccessToken::where('token', $token)->delete();
67 67
     }
68 68
 
69 69
     /**
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public function deleteAccessTokenByUser(int $user_id, string $user_type): bool
78 78
     {
79
-        return (bool)AccessToken::where('user_id', $user_id)->where('user_type', $user_type)->delete();
79
+        return (bool) AccessToken::where('user_id', $user_id)->where('user_type', $user_type)->delete();
80 80
     }
81 81
 
82 82
     /**
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public function deactivationAccessTokenById(int $token_id): bool
101 101
     {
102
-        return (bool)AccessToken::where('id', $token_id)->update([
102
+        return (bool) AccessToken::where('id', $token_id)->update([
103 103
             'expiration' => Carbon::now()->subMinutes(),
104 104
         ]);
105 105
     }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function deactivationAccessToken(string $token): bool
115 115
     {
116
-        return (bool)AccessToken::where('token', $token)->update([
116
+        return (bool) AccessToken::where('token', $token)->update([
117 117
             'expiration' => Carbon::now()->subMinutes(),
118 118
         ]);
119 119
     }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     public function deactivationAccessTokenByUser(int $user_id, string $user_type): bool
130 130
     {
131
-        return (bool)AccessToken::where('user_id', $user_id)
131
+        return (bool) AccessToken::where('user_id', $user_id)
132 132
             ->where('user_type', $user_type)
133 133
             ->update([
134 134
                 'expiration' => Carbon::now()->subMinutes(),
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
      */
146 146
     public function prolongationAccessTokenById(int $token_id, ?DateTime $expiration = null): bool
147 147
     {
148
-        return (bool)AccessToken::where('id', $token_id)->update(['expiration' => $expiration]);
148
+        return (bool) AccessToken::where('id', $token_id)->update(['expiration' => $expiration]);
149 149
     }
150 150
 
151 151
     /**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
      */
159 159
     public function prolongationAccessToken(string $token, ?DateTime $expiration = null): bool
160 160
     {
161
-        return (bool)AccessToken::where('token', $token)->update(['expiration' => $expiration]);
161
+        return (bool) AccessToken::where('token', $token)->update(['expiration' => $expiration]);
162 162
     }
163 163
 
164 164
     /**
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
      */
173 173
     public function prolongationAccessTokenByUser(int $user_id, string $user_type, ?DateTime $expiration = null): bool
174 174
     {
175
-        return (bool)AccessToken::where('user_id', $user_id)
175
+        return (bool) AccessToken::where('user_id', $user_id)
176 176
             ->where('user_type', $user_type)
177 177
             ->update(['expiration' => $expiration]);
178 178
     }
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
         string   $user_type,
198 198
         string   $token
199 199
     ): bool {
200
-        return (bool)AccessToken::where('id', $token_id)->update([
200
+        return (bool) AccessToken::where('id', $token_id)->update([
201 201
             'token'      => $token,
202 202
             'user_id'    => $user_id,
203 203
             'user_type'  => $user_type,
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
      */
255 255
     public function setLastUseAccessToken(string $token): bool
256 256
     {
257
-        return (bool)AccessToken::where('token', $token)->update([
257
+        return (bool) AccessToken::where('token', $token)->update([
258 258
             'last_use' => Carbon::now()->subMinutes(),
259 259
         ]);
260 260
     }
Please login to merge, or discard this patch.