Passed
Push — master ( c04192...260b04 )
by Simon
09:46 queued 07:21
created
tests/unit/JWTAuthenticationHandlerTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         Environment::putEnv('JWT_SIGNER_KEY=string');
50 50
 
51 51
         $request = clone Controller::curr()->getRequest();
52
-        $request->addHeader('Authorization', 'Bearer ' . $this->token);
52
+        $request->addHeader('Authorization', 'Bearer '.$this->token);
53 53
 
54 54
         $handler = JWTAuthenticationHandler::singleton();
55 55
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     public function testAuthenticateRequest()
66 66
     {
67 67
         $request = clone Controller::curr()->getRequest();
68
-        $request->addHeader('Authorization', 'Bearer ' . $this->token);
68
+        $request->addHeader('Authorization', 'Bearer '.$this->token);
69 69
 
70 70
         $handler = JWTAuthenticationHandler::singleton();
71 71
 
Please login to merge, or discard this patch.
tests/unit/RefreshTokenMutationCreatorTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
     {
72 72
         $token = $anonymous ? $this->anonymousToken : $this->token;
73 73
         $request = clone Controller::curr()->getRequest();
74
-        $request->addHeader('Authorization', 'Bearer ' . $token);
74
+        $request->addHeader('Authorization', 'Bearer '.$token);
75 75
 
76 76
         $request->setSession(new Session(['hello' => 'bye'])); // We need a session
77 77
         Controller::curr()->setRequest($request);
Please login to merge, or discard this patch.
tests/unit/JWTAuthenticatorTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     {
51 51
         $authenticator = JWTAuthenticator::singleton();
52 52
         $request = clone Controller::curr()->getRequest();
53
-        $request->addHeader('Authorization', 'Bearer ' . $this->token);
53
+        $request->addHeader('Authorization', 'Bearer '.$this->token);
54 54
 
55 55
         $result = $authenticator->authenticate(['token' => $this->token], $request);
56 56
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
         $authenticator = JWTAuthenticator::singleton();
69 69
         $request = clone Controller::curr()->getRequest();
70
-        $request->addHeader('Authorization', 'Bearer ' . $this->token);
70
+        $request->addHeader('Authorization', 'Bearer '.$this->token);
71 71
 
72 72
         $result = $authenticator->authenticate(['token' => $this->token], $request);
73 73
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     {
82 82
         $authenticator = JWTAuthenticator::singleton();
83 83
         $request = clone Controller::curr()->getRequest();
84
-        $request->addHeader('Authorization', 'Bearer ' . $this->token);
84
+        $request->addHeader('Authorization', 'Bearer '.$this->token);
85 85
 
86 86
         // Invalidate the Unique ID by making it something arbitrarily wrong
87 87
         /** @var Member|MemberExtension $member */
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     public function testRSAKey()
103 103
     {
104
-        $keys = realpath(__DIR__ . '/../keys');
104
+        $keys = realpath(__DIR__.'/../keys');
105 105
         Environment::setEnv('JWT_SIGNER_KEY', "{$keys}/private.key");
106 106
         Environment::setEnv('JWT_PUBLIC_KEY', "{$keys}/public.pub");
107 107
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
         $authenticator = JWTAuthenticator::singleton();
120 120
         $request = clone Controller::curr()->getRequest();
121
-        $request->addHeader('Authorization', 'Bearer ' . $token);
121
+        $request->addHeader('Authorization', 'Bearer '.$token);
122 122
 
123 123
         $result = $authenticator->authenticate(['token' => $token], $request);
124 124
 
Please login to merge, or discard this patch.
tests/unit/ValidateTokenQueryCreatorTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
     private function buildRequest()
54 54
     {
55 55
         $request = clone Controller::curr()->getRequest();
56
-        $request->addHeader('Authorization', 'Bearer ' . $this->token);
56
+        $request->addHeader('Authorization', 'Bearer '.$this->token);
57 57
         $request->setSession(new Session(['hello' => 'bye'])); // We need a session
58 58
         Controller::curr()->setRequest($request);
59 59
 
Please login to merge, or discard this patch.
src/Authentication/AnonymousUserAuthenticator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         return Authenticator::LOGIN | Authenticator::LOGOUT;
30 30
     }
31 31
 
32
-    public function authenticate(array $data, HTTPRequest $request, ValidationResult &$result = null): ?Member
32
+    public function authenticate(array $data, HTTPRequest $request, ValidationResult & $result = null): ?Member
33 33
     {
34 34
         // Only applies to request for anonymous user specifically
35 35
         $email = $data['Email'] ?? null;
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
      * @param Member $member This third parameter is used in the CMSAuthenticator(s)
50 50
      * @return Member Found member, regardless of successful login
51 51
      */
52
-    protected function authenticateMember($data, ValidationResult &$result = null, Member $member = null): Member
52
+    protected function authenticateMember($data, ValidationResult & $result = null, Member $member = null): Member
53 53
     {
54 54
         // Get user, or create if not exists
55 55
         $username = static::config()->get('anonymous_username');
56
-        $member = Injector::inst()->get(Member::class . '.anonymous', true, ['username' => $username]);
56
+        $member = Injector::inst()->get(Member::class.'.anonymous', true, ['username' => $username]);
57 57
 
58 58
         // Validate this member is still allowed to login
59 59
         $result = $result ?: ValidationResult::create();
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         return $member;
70 70
     }
71 71
 
72
-    public function checkPassword(Member $member, $password, ValidationResult &$result = null)
72
+    public function checkPassword(Member $member, $password, ValidationResult & $result = null)
73 73
     {
74 74
         throw new BadMethodCallException("checkPassword not supported for anonymous users");
75 75
     }
Please login to merge, or discard this patch.
src/Authentication/JWTAuthenticator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         }
173 173
 
174 174
         // Build key from path
175
-        return new Key('file://' . $path, $password);
175
+        return new Key('file://'.$path, $password);
176 176
     }
177 177
 
178 178
     /**
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
      * @throws BadMethodCallException
195 195
      * @throws Exception
196 196
      */
197
-    public function authenticate(array $data, HTTPRequest $request, ValidationResult &$result = null): ?Member
197
+    public function authenticate(array $data, HTTPRequest $request, ValidationResult & $result = null): ?Member
198 198
     {
199 199
         if (!$result) {
200 200
             $result = new ValidationResult();
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
     protected function resolvePath(string $path, string $base = BASE_PATH): ?string
383 383
     {
384 384
         if (strstr($path, '/') !== 0) {
385
-            $path = $base . '/' . $path;
385
+            $path = $base.'/'.$path;
386 386
         }
387 387
         return realpath($path) ?: null;
388 388
     }
Please login to merge, or discard this patch.