Passed
Push — main ( 2e94d7...69451c )
by Garbuz
02:43
created
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(TokenRepository::class, function () {
65
+        $this->app->singleton(TokenRepository::class, function() {
66 66
             return new TokenRepository;
67 67
         });
68 68
         $this->app->bind(TokenRepositoryInterface::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(TokenRepositoryInterface::class));
71 71
         });
72 72
     }
Please login to merge, or discard this patch.
src/Config.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -59,11 +59,11 @@
 block discarded – undo
59 59
      */
60 60
     public function load(): Config
61 61
     {
62
-        $this->encryption = (bool)config($this->configName . '.encryption', $this->encryption);
63
-        $this->autoClear = (bool)config($this->configName . '.auto_clear', $this->autoClear);
62
+        $this->encryption = (bool) config($this->configName . '.encryption', $this->encryption);
63
+        $this->autoClear = (bool) config($this->configName . '.auto_clear', $this->autoClear);
64 64
         $this->autoClearPause = intval(config($this->configName . '.auto_clear_pause', $this->autoClearPause));
65
-        $this->repository = (string)config($this->configName . '.repository', $this->repository);
66
-        $this->lastUse = (bool)config($this->configName . '.last_use', $this->lastUse);
65
+        $this->repository = (string) config($this->configName . '.repository', $this->repository);
66
+        $this->lastUse = (bool) config($this->configName . '.last_use', $this->lastUse);
67 67
         return $this;
68 68
     }
69 69
 
Please login to merge, or discard this patch.
src/Repositories/TokenRepository.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function deleteById(int $token_id): bool
42 42
     {
43
-        return (bool)Token::where('id', $token_id)->delete();
43
+        return (bool) Token::where('id', $token_id)->delete();
44 44
     }
45 45
 
46 46
     /**
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public function deleteByToken(string $token): bool
52 52
     {
53
-        return (bool)Token::where('token', $token)->delete();
53
+        return (bool) Token::where('token', $token)->delete();
54 54
     }
55 55
 
56 56
     /**
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function deleteByUser(int $user_id): bool
62 62
     {
63
-        return (bool)Token::where('user_id', $user_id)->delete();
63
+        return (bool) Token::where('user_id', $user_id)->delete();
64 64
     }
65 65
 
66 66
     /**
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function deactivationById(int $token_id): bool
82 82
     {
83
-        return (bool)Token::where('id', $token_id)->update([
83
+        return (bool) Token::where('id', $token_id)->update([
84 84
             'expiration' => Carbon::now()->subMinutes()
85 85
         ]);
86 86
     }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public function deactivationByToken(string $token): bool
94 94
     {
95
-        return (bool)Token::where('token', $token)->update([
95
+        return (bool) Token::where('token', $token)->update([
96 96
             'expiration' => Carbon::now()->subMinutes()
97 97
         ]);
98 98
     }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function deactivationByUser(int $user_id): bool
106 106
     {
107
-        return (bool)Token::where('user_id', $user_id)->update([
107
+        return (bool) Token::where('user_id', $user_id)->update([
108 108
             'expiration' => Carbon::now()->subMinutes()
109 109
         ]);
110 110
     }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      */
118 118
     public function prolongationById(int $token_id, DateTime $expiration): bool
119 119
     {
120
-        return (bool)Token::where('id', $token_id)->update(['expiration' => $expiration]);
120
+        return (bool) Token::where('id', $token_id)->update(['expiration' => $expiration]);
121 121
     }
122 122
 
123 123
     /**
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     public function prolongationByToken(string $token, DateTime $expiration): bool
130 130
     {
131
-        return (bool)Token::where('token', $token)->update(['expiration' => $expiration]);
131
+        return (bool) Token::where('token', $token)->update(['expiration' => $expiration]);
132 132
     }
133 133
 
134 134
     /**
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      */
140 140
     public function prolongationByUser(int $user_id, DateTime $expiration): bool
141 141
     {
142
-        return (bool)Token::where('user_id', $user_id)->update(['expiration' => $expiration]);
142
+        return (bool) Token::where('user_id', $user_id)->update(['expiration' => $expiration]);
143 143
     }
144 144
 
145 145
     /**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         ?int     $user_id = null,
159 159
         string   $token = null
160 160
     ): bool {
161
-        return (bool)Token::where('id', $token_id)->update([
161
+        return (bool) Token::where('id', $token_id)->update([
162 162
             'token' => $token,
163 163
             'user_id' => $user_id,
164 164
             'title' => $title,
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
      */
204 204
     public function setLastUse(string $token): bool
205 205
     {
206
-        return (bool)Token::where('token', $token)->update([
206
+        return (bool) Token::where('token', $token)->update([
207 207
             'last_use' => Carbon::now()->subMinutes()
208 208
         ]);
209 209
     }
Please login to merge, or discard this patch.