@@ -59,14 +59,14 @@ |
||
| 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 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | /** |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | string $token = null |
| 160 | 160 | ): bool |
| 161 | 161 | { |
| 162 | - return (bool)Token::where('id', $token_id)->update([ |
|
| 162 | + return (bool) Token::where('id', $token_id)->update([ |
|
| 163 | 163 | 'token' => $token, |
| 164 | 164 | 'user_id' => $user_id, |
| 165 | 165 | 'title' => $title, |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | */ |
| 205 | 205 | public function setLastUse(string $token): bool |
| 206 | 206 | { |
| 207 | - return (bool)Token::where('token', $token)->update([ |
|
| 207 | + return (bool) Token::where('token', $token)->update([ |
|
| 208 | 208 | 'last_use' => Carbon::now()->subMinutes() |
| 209 | 209 | ]); |
| 210 | 210 | } |
@@ -59,11 +59,11 @@ |
||
| 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 | |