Completed
Push — master ( 3d5774...6cab55 )
by Roman
03:17
created
src/Storage/CacheStorage.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     protected $tag;
19 19
 
20 20
     /**
21
-     * @param \Illuminate\Cache\CacheManager  $cache
21
+     * @param Repository  $cache
22 22
      * @param string $tag
23 23
      */
24 24
     public function __construct(Repository $cache, $tag = 'jwt')
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      * Add a new item into storage.
32 32
      *
33 33
      * @param  string  $key
34
-     * @param  mixed  $value
34
+     * @param  string  $value
35 35
      * @param  int  $minutes
36 36
      * @return void
37 37
      */
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     /**
44 44
      * @param  string  $key
45
-     * @param  mixed  $value
45
+     * @param  string  $value
46 46
      * @return void
47 47
      */
48 48
     public function forever($key, $value)
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
tests/BlacklistTest.php 1 patch
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -163,6 +163,10 @@
 block discarded – undo
163 163
         $this->assertEquals(500, $property->getValue($list));
164 164
     }
165 165
 
166
+    /**
167
+     * @param string $id
168
+     * @param integer $exp
169
+     */
166 170
     protected function tokenStub($id = null, $exp = null, $claims = [])
167 171
     {
168 172
         $builder = new \Lcobucci\JWT\Builder();
Please login to merge, or discard this patch.
tests/ServiceProviderTest.php 3 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -9,6 +9,10 @@
 block discarded – undo
9 9
 }
10 10
 
11 11
 if (!function_exists('config_path')) {
12
+
13
+    /**
14
+     * @param string $path
15
+     */
12 16
     function config_path($path) {
13 17
         return $path;
14 18
     }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,13 +51,13 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,13 +3,15 @@
 block discarded – undo
3 3
 use Mockery as m;
4 4
 
5 5
 if (!function_exists('env')) {
6
-    function env($name, $default = null) {
6
+    function env($name, $default = null)
7
+    {
7 8
         return $default;
8 9
     }
9 10
 }
10 11
 
11 12
 if (!function_exists('config_path')) {
12
-    function config_path($path) {
13
+    function config_path($path)
14
+    {
13 15
         return $path;
14 16
     }
15 17
 }
Please login to merge, or discard this patch.
tests/SigningTokensTest.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -37,6 +37,9 @@
 block discarded – undo
37 37
 {
38 38
     use \Framgia\Jwt\SigningTokens;
39 39
 
40
+    /**
41
+     * @param string $type
42
+     */
40 43
     public function signer($algorithm = 'sha256', $type = null)
41 44
     {
42 45
         // Pass call to protected method
Please login to merge, or discard this patch.
src/Guard.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,8 +48,7 @@
 block discarded – undo
48 48
         Request $request,
49 49
         Blacklist $blacklist,
50 50
         Signer $signer
51
-    )
52
-    {
51
+    ) {
53 52
         $this->request = $request;
54 53
         $this->provider = $provider;
55 54
         $this->blacklist = $blacklist;
Please login to merge, or discard this patch.
src/Blacklist.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
tests/CacheStorageTest.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,4 +49,6 @@
 block discarded – undo
49 49
     }
50 50
 }
51 51
 
52
-abstract class TaggedStoreStub extends \Illuminate\Cache\TaggableStore implements \Illuminate\Contracts\Cache\Store {}
52
+abstract class TaggedStoreStub extends \Illuminate\Cache\TaggableStore implements \Illuminate\Contracts\Cache\Store
53
+{
54
+}
Please login to merge, or discard this patch.
tests/GuardTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/SigningTokens.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.