@@ -89,7 +89,7 @@ |
||
| 89 | 89 | */ |
| 90 | 90 | protected function cache() |
| 91 | 91 | { |
| 92 | - if (! method_exists($this->cache, 'tags')) { |
|
| 92 | + if (!method_exists($this->cache, 'tags')) { |
|
| 93 | 93 | return $this->cache; |
| 94 | 94 | } |
| 95 | 95 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | // If we've already retrieved the user for the current request we can just |
| 67 | 67 | // return it back immediately. We do not want to fetch the user data on |
| 68 | 68 | // every call to this method because that would be tremendously slow. |
| 69 | - if (! is_null($this->user)) { |
|
| 69 | + if (!is_null($this->user)) { |
|
| 70 | 70 | return $this->user; |
| 71 | 71 | } |
| 72 | 72 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | $token = $this->getTokenForRequest(); |
| 76 | 76 | |
| 77 | - if (! is_null($token)) { |
|
| 77 | + if (!is_null($token)) { |
|
| 78 | 78 | $user = $this->provider->retrieveById($token->getClaim('sub')); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $builder->setSubject($id); |
| 141 | 141 | |
| 142 | 142 | if ($this->user instanceof ProvidesCredentials) { |
| 143 | - foreach($this->user->getCredentials() as $key => $value) { |
|
| 143 | + foreach ($this->user->getCredentials() as $key => $value) { |
|
| 144 | 144 | $builder->set($key, $value); |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -16,14 +16,14 @@ discard block |
||
| 16 | 16 | public function boot() |
| 17 | 17 | { |
| 18 | 18 | $this->publishes([ |
| 19 | - __DIR__ . '/../config/jwt.php' => config_path('api.php') |
|
| 19 | + __DIR__.'/../config/jwt.php' => config_path('api.php') |
|
| 20 | 20 | ]); |
| 21 | 21 | |
| 22 | - $this->mergeConfigFrom(__DIR__ . '/../config/jwt.php', 'jwt'); |
|
| 22 | + $this->mergeConfigFrom(__DIR__.'/../config/jwt.php', 'jwt'); |
|
| 23 | 23 | |
| 24 | 24 | $manager = $this->app[AuthManager::class]; |
| 25 | 25 | |
| 26 | - $manager->extend('jwt', function ($app, $name, $config) use ($manager) { |
|
| 26 | + $manager->extend('jwt', function($app, $name, $config) use ($manager) { |
|
| 27 | 27 | $guard = new Guard($manager->provider($config['provider']), $app[Request::class], $app[Blacklist::class], $app[SignerContract::class]); |
| 28 | 28 | |
| 29 | 29 | $app->refresh(Request::class, $guard, 'setRequest'); |
@@ -39,19 +39,19 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | public function register() |
| 41 | 41 | { |
| 42 | - $this->app->singleton(CacheStorage::class, function ($app) { |
|
| 42 | + $this->app->singleton(CacheStorage::class, function($app) { |
|
| 43 | 43 | return new CacheStorage($app[Cache::class]); |
| 44 | 44 | }); |
| 45 | 45 | |
| 46 | - $this->app->singleton(Blacklist::class, function ($app) { |
|
| 46 | + $this->app->singleton(Blacklist::class, function($app) { |
|
| 47 | 47 | return new Blacklist($app[StorageContract::class]); |
| 48 | 48 | }); |
| 49 | 49 | |
| 50 | - $this->app->singleton(SignerFactory::class, function ($app) { |
|
| 50 | + $this->app->singleton(SignerFactory::class, function($app) { |
|
| 51 | 51 | return new SignerFactory($app); |
| 52 | 52 | }); |
| 53 | 53 | |
| 54 | - $this->app->bind(SignerContract::class, function ($app) { |
|
| 54 | + $this->app->bind(SignerContract::class, function($app) { |
|
| 55 | 55 | return $app[SignerFactory::class]->driver(); |
| 56 | 56 | }); |
| 57 | 57 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | { |
| 56 | 56 | // if there is no exp claim then add the jwt to |
| 57 | 57 | // the blacklist indefinitely |
| 58 | - if (! $token->hasClaim('exp')) { |
|
| 58 | + if (!$token->hasClaim('exp')) { |
|
| 59 | 59 | return $this->addForever($token); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | // check whether the expiry + grace has past |
| 117 | - return $val !== null && ! Carbon::createFromTimestamp($val['valid_until'])->isFuture(); |
|
| 117 | + return $val !== null && !Carbon::createFromTimestamp($val['valid_until'])->isFuture(); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | $auth = m::mock(\Illuminate\Auth\AuthManager::class); |
| 41 | 41 | $auth->shouldReceive('extend')->once(); |
| 42 | 42 | |
| 43 | - $app->singleton(\Illuminate\Auth\AuthManager::class, function () use ($auth) { |
|
| 43 | + $app->singleton(\Illuminate\Auth\AuthManager::class, function() use ($auth) { |
|
| 44 | 44 | return $auth; |
| 45 | 45 | }); |
| 46 | 46 | |