Passed
Push — main ( 12e7e2...8f14aa )
by Garbuz
03:18
created
src/Repositories/AccessTokenRepository.php 1 patch
Spacing   +10 added lines, -10 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
     }
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
      */
226 226
     public function setLastUseAccessToken(string $token): bool
227 227
     {
228
-        return (bool)AccessToken::where('token', $token)->update([
228
+        return (bool) AccessToken::where('token', $token)->update([
229 229
             'last_use' => Carbon::now()->subMinutes(),
230 230
         ]);
231 231
     }
Please login to merge, or discard this patch.
src/Repositories/GlobalTokenRepository.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function deleteGlobalTokenById(int $token_id): bool
44 44
     {
45
-        return (bool)GlobalToken::where('id', $token_id)->delete();
45
+        return (bool) GlobalToken::where('id', $token_id)->delete();
46 46
     }
47 47
 
48 48
     /**
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function deleteGlobalToken(string $token): bool
56 56
     {
57
-        return (bool)GlobalToken::where('token', $token)->delete();
57
+        return (bool) GlobalToken::where('token', $token)->delete();
58 58
     }
59 59
 
60 60
     /**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function deactivationGlobalTokenById(int $token_id): bool
79 79
     {
80
-        return (bool)GlobalToken::where('id', $token_id)->update([
80
+        return (bool) GlobalToken::where('id', $token_id)->update([
81 81
             'expiration' => Carbon::now()->subMinutes(),
82 82
         ]);
83 83
     }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     public function deactivationGlobalToken(string $token): bool
93 93
     {
94
-        return (bool)GlobalToken::where('token', $token)->update([
94
+        return (bool) GlobalToken::where('token', $token)->update([
95 95
             'expiration' => Carbon::now()->subMinutes(),
96 96
         ]);
97 97
     }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      */
107 107
     public function prolongationGlobalTokenById(int $token_id, ?DateTime $expiration = null): bool
108 108
     {
109
-        return (bool)GlobalToken::where('id', $token_id)->update(['expiration' => $expiration]);
109
+        return (bool) GlobalToken::where('id', $token_id)->update(['expiration' => $expiration]);
110 110
     }
111 111
 
112 112
     /**
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      */
120 120
     public function prolongationGlobalToken(string $token, ?DateTime $expiration = null): bool
121 121
     {
122
-        return (bool)GlobalToken::where('token', $token)->update(['expiration' => $expiration]);
122
+        return (bool) GlobalToken::where('token', $token)->update(['expiration' => $expiration]);
123 123
     }
124 124
 
125 125
     /**
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
      */
156 156
     public function setLastUseGlobalToken(string $token): bool
157 157
     {
158
-        return (bool)GlobalToken::where('token', $token)->update([
158
+        return (bool) GlobalToken::where('token', $token)->update([
159 159
             'last_use' => Carbon::now()->subMinutes(),
160 160
         ]);
161 161
     }
Please login to merge, or discard this patch.
src/Config.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -88,14 +88,14 @@
 block discarded – undo
88 88
      */
89 89
     public function load(): Config
90 90
     {
91
-        $this->encryption = (bool)config($this->configName . '.encryption', $this->encryption);
92
-        $this->autoClear = (bool)config($this->configName . '.auto_clear', $this->autoClear);
91
+        $this->encryption = (bool) config($this->configName . '.encryption', $this->encryption);
92
+        $this->autoClear = (bool) config($this->configName . '.auto_clear', $this->autoClear);
93 93
         $this->autoClearPause = intval(config($this->configName . '.auto_clear_pause', $this->autoClearPause));
94
-        $this->repository_global = (string)config($this->configName . '.repository_global', $this->repository_global);
95
-        $this->repository_access = (string)config($this->configName . '.repository_global', $this->repository_access);
96
-        $this->lastUse = (bool)config($this->configName . '.last_use', $this->lastUse);
97
-        $this->jwt = (bool)config($this->configName . '.jwt', $this->jwt);
98
-        $this->salt = (string)config($this->configName . '.salt', $this->salt);
94
+        $this->repository_global = (string) config($this->configName . '.repository_global', $this->repository_global);
95
+        $this->repository_access = (string) config($this->configName . '.repository_global', $this->repository_access);
96
+        $this->lastUse = (bool) config($this->configName . '.last_use', $this->lastUse);
97
+        $this->jwt = (bool) config($this->configName . '.jwt', $this->jwt);
98
+        $this->salt = (string) config($this->configName . '.salt', $this->salt);
99 99
         $this->salt = file_exists($this->salt) ? file_get_contents($this->salt) : $this->salt;
100 100
         return $this;
101 101
     }
Please login to merge, or discard this patch.
src/ServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 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 65
         $this->app->bind(
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             GlobalTokenRepositoryInterface::class,
71 71
             app(Config::class)->getRepositoryGlobalToken()
72 72
         );
73
-        $this->app->singleton(TokenManager::class, function () {
73
+        $this->app->singleton(TokenManager::class, function() {
74 74
             return new TokenManager(
75 75
                 app(Config::class),
76 76
                 app(AccessTokenRepositoryInterface::class),
Please login to merge, or discard this patch.