@@ -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 | } |
@@ -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 | /** |
@@ -51,13 +51,13 @@ |
||
51 | 51 | { |
52 | 52 | $app = m::mock(ApplicationStub::class)->makePartial(); |
53 | 53 | |
54 | - $app->singleton('config', function() { |
|
54 | + $app->singleton('config', function () { |
|
55 | 55 | $repo = new \Illuminate\Config\Repository(); |
56 | - $repo->set('jwt', include __DIR__.'/../config/jwt.php'); |
|
56 | + $repo->set('jwt', include __DIR__ . '/../config/jwt.php'); |
|
57 | 57 | return $repo; |
58 | 58 | }); |
59 | 59 | |
60 | - $app->singleton(\Illuminate\Contracts\Cache\Repository::class, function() { |
|
60 | + $app->singleton(\Illuminate\Contracts\Cache\Repository::class, function () { |
|
61 | 61 | return m::mock(\Illuminate\Contracts\Cache\Repository::class); |
62 | 62 | }); |
63 | 63 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | $signer->shouldReceive('verify')->once()->andReturn(true); |
45 | 45 | |
46 | - $request->headers->set('Authorization', 'Bearer '.$token); |
|
46 | + $request->headers->set('Authorization', 'Bearer ' . $token); |
|
47 | 47 | |
48 | 48 | $guard = new Framgia\Jwt\Guard($provider, $request, $blacklist, $signer); |
49 | 49 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | $token = $signer->sign((new \Lcobucci\JWT\Builder())->setSubject(1)->setExpiration(time() + 3600))->getToken(); |
67 | 67 | |
68 | - $request->headers->set('Authorization', 'Bearer '.$token); |
|
68 | + $request->headers->set('Authorization', 'Bearer ' . $token); |
|
69 | 69 | |
70 | 70 | $guard = new Framgia\Jwt\Guard($provider, $request, $blacklist, $signer); |
71 | 71 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $request = Illuminate\Http\Request::create('/'); |
258 | 258 | $signer->shouldReceive('verify')->once()->andReturn(true); |
259 | 259 | |
260 | - $request->headers->set('Authorization', 'Bearer '.$token); |
|
260 | + $request->headers->set('Authorization', 'Bearer ' . $token); |
|
261 | 261 | |
262 | 262 | $guard = new Framgia\Jwt\Guard($provider, $request, $blacklist, $signer); |
263 | 263 |
@@ -20,10 +20,10 @@ |
||
20 | 20 | |
21 | 21 | // Check if provided class exists and extends BaseVerifier |
22 | 22 | // to avoid possible code injections |
23 | - if (is_subclass_of($class = Signer::class.'\\'.$type.'\\'.$algorithm, Signer\BaseSigner::class)) { |
|
23 | + if (is_subclass_of($class = Signer::class . '\\' . $type . '\\' . $algorithm, Signer\BaseSigner::class)) { |
|
24 | 24 | return new $class; |
25 | 25 | } |
26 | 26 | |
27 | - throw new InvalidArgumentException('['.$algorithm.'] is not supported in ['.$type.'] verifier.'); |
|
27 | + throw new InvalidArgumentException('[' . $algorithm . '] is not supported in [' . $type . '] verifier.'); |
|
28 | 28 | } |
29 | 29 | } |