Completed
Push — master ( a88ebf...a6f5e7 )
by John
02:15
created
src/Authenticator/JwtKey.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@
 block discarded – undo
151 151
         if ($this->requiredClaims) {
152 152
             $missing = array_diff_key(array_flip($this->requiredClaims), $claims);
153 153
             if (count($missing)) {
154
-                throw new \InvalidArgumentException("Missing claims: " . implode(', ', $missing));
154
+                throw new \InvalidArgumentException("Missing claims: ".implode(', ', $missing));
155 155
             }
156 156
         }
157 157
         if ($this->issuer && !isset($claims['iss'])) {
Please login to merge, or discard this patch.
src/DependencyInjection/KleijnWebJwtExtension.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     public function load(array $configs, ContainerBuilder $container)
27 27
     {
28 28
         $config = $this->processConfiguration(new Configuration(), $configs);
29
-        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
29
+        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
30 30
         $loader->load('services.yml');
31 31
 
32 32
         $keys = [];
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         foreach ($config['keys'] as $keyId => $keyConfig) {
35 35
 
36 36
             $keyConfig['kid'] = $keyId;
37
-            $keyDefinition    = new Definition('jwt.keys.' . $keyId);
37
+            $keyDefinition    = new Definition('jwt.keys.'.$keyId);
38 38
             $keyDefinition->setClass('KleijnWeb\JwtBundle\Authenticator\JwtKey');
39 39
 
40 40
             if (isset($keyConfig['loader'])) {
Please login to merge, or discard this patch.
tests/functional/App/TestBundle.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 class TestBundle extends Bundle
21 21
 {
22 22
     /**
23
-     * @return ExtensionInterface
23
+     * @return boolean
24 24
      */
25 25
     public function getContainerExtension()
26 26
     {
Please login to merge, or discard this patch.
tests/functional/FunctionalTest.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 
11 11
 use KleijnWeb\JwtBundle\Tests\Authenticator\AuthenticatorTest;
12 12
 use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
13
-use Symfony\Bundle\FrameworkBundle\Client;
14 13
 
15 14
 /**
16 15
  * @author John Kleijn <[email protected]>
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
         $client = $this->createClient();
97 97
         $server = [];
98 98
         if ($token) {
99
-            $server = ['HTTP_AUTHORIZATION' => 'Bearer ' . $token];
99
+            $server = ['HTTP_AUTHORIZATION' => 'Bearer '.$token];
100 100
         }
101 101
         $client->request('GET', $url, $parameters = [], $files = [], $server);
102 102
 
Please login to merge, or discard this patch.
src/Authenticator/Authenticator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     {
68 68
         $tokenString = $request->headers->get('Authorization');
69 69
 
70
-        if (0 === strpos((string)$tokenString, 'Bearer ')) {
70
+        if (0 === strpos((string) $tokenString, 'Bearer ')) {
71 71
             $tokenString = substr($tokenString, 7);
72 72
         }
73 73
 
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
             if ($claimKey === 'aud') {
136 136
                 if (is_array($claimValue)) {
137 137
                     foreach ($claimValue as $role) {
138
-                        $user->addRole("ROLE_" . strtoupper($role));
138
+                        $user->addRole("ROLE_".strtoupper($role));
139 139
                     }
140 140
                 } elseif (is_string($claimValue)) {
141
-                    $user->addRole("ROLE_" . strtoupper($claimValue));
141
+                    $user->addRole("ROLE_".strtoupper($claimValue));
142 142
                 }
143 143
             }
144 144
         }
Please login to merge, or discard this patch.
tests/unit/Authenticator/AuthenticatorTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@
 block discarded – undo
175 175
     {
176 176
         $authenticator = new Authenticator($this->keys);
177 177
         $request       = new Request();
178
-        $request->headers->set('Authorization', 'Bearer ' . self::TEST_TOKEN);
178
+        $request->headers->set('Authorization', 'Bearer '.self::TEST_TOKEN);
179 179
         $token = $authenticator->createToken($request, 'myprovider');
180 180
 
181 181
         $expected = new JwtToken(self::TEST_TOKEN);
Please login to merge, or discard this patch.
tests/unit/Authenticator/JwtKeyTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function validateTokenWillCallVerifySignatureOnToken()
65 65
     {
66
-        $secret = (string)rand();
66
+        $secret = (string) rand();
67 67
         $key    = new JwtKey(['secret' => $secret]);
68 68
         $key->validateToken($this->createTokenMock($secret, $key));
69 69
     }
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public function canLoadSecretFromLoader()
84 84
     {
85
-        $secret = (string)rand();
85
+        $secret = (string) rand();
86 86
         $token  = $this->createTokenMock($secret);
87 87
 
88 88
         $loaderMock = $this->getMockBuilder('KleijnWeb\JwtBundle\Authenticator\SecretLoader')->getMock();
Please login to merge, or discard this patch.
tests/functional/App/app/TestKernel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,6 +25,6 @@
 block discarded – undo
25 25
      */
26 26
     public function registerContainerConfiguration(LoaderInterface $loader)
27 27
     {
28
-        $loader->load(__DIR__ . '/config.yml');
28
+        $loader->load(__DIR__.'/config.yml');
29 29
     }
30 30
 }
Please login to merge, or discard this patch.
tests/functional/TestCacheSmashingPHPUnitListener.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
             return;
69 69
         }
70 70
 
71
-        $dir = __DIR__ . '/App/app/cache';
71
+        $dir = __DIR__.'/App/app/cache';
72 72
 
73 73
         if (!is_dir($dir)) {
74 74
             return;
Please login to merge, or discard this patch.