Passed
Push — master ( cbaac8...874fe2 )
by meta
02:40
created
src/Controllers/ApiAuthController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         $appId = $appData->azp;
101 101
         $app = \Metaclassing\EnterpriseAuth\Models\AzureApp::where('id', $appId)->first();
102 102
         // If we dont have an existing app go create one
103
-        if (! $app) {
103
+        if (!$app) {
104 104
             $azureApp = [
105 105
                 'id'   => $appId,
106 106
                 'name' => $appId,
@@ -117,16 +117,16 @@  discard block
 block discarded – undo
117 117
         // Unpack our jwt to verify it is correctly formed
118 118
         $token = $this->unpackJwt($accessToken);
119 119
         // app tokens must be signed in RSA
120
-        if (! isset($token['header']['alg']) || $token['header']['alg'] != 'RS256') {
120
+        if (!isset($token['header']['alg']) || $token['header']['alg'] != 'RS256') {
121 121
             throw new \Exception('Token is not using the correct signing algorithm RS256 '.$accessToken);
122 122
         }
123 123
         // app tokens are RSA signed with a key ID in the header of the token
124
-        if (! isset($token['header']['kid'])) {
124
+        if (!isset($token['header']['kid'])) {
125 125
             throw new \Exception('Token with unknown RSA key id can not be validated '.$accessToken);
126 126
         }
127 127
         // Make sure the key id is known to our azure ad information
128 128
         $kid = $token['header']['kid'];
129
-        if (! isset($this->azureActiveDirectory->signingKeys[$kid])) {
129
+        if (!isset($this->azureActiveDirectory->signingKeys[$kid])) {
130 130
             throw new \Exception('Token signed with unknown KID '.$kid);
131 131
         }
132 132
         // get the x509 encoded cert body
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         $roles = $user->roles()->get()->all();
204 204
         foreach ($roles as $key => $role) {
205 205
             $role->permissions = $role->abilities()->get()->all();
206
-            if (! count($role->permissions)) {
206
+            if (!count($role->permissions)) {
207 207
                 unset($roles[$key]);
208 208
             }
209 209
         }
Please login to merge, or discard this patch.