| @@ -40,8 +40,8 @@ discard block | ||
| 40 | 40 | $graph = new \Microsoft\Graph\Graph(); | 
| 41 | 41 | $graph->setAccessToken($accessToken); | 
| 42 | 42 |          $user = $graph->createRequest('GET', '/me') | 
| 43 | - ->setReturnType(\Microsoft\Graph\Model\User::class) | |
| 44 | - ->execute(); | |
| 43 | + ->setReturnType(\Microsoft\Graph\Model\User::class) | |
| 44 | + ->execute(); | |
| 45 | 45 | |
| 46 | 46 | return $user->jsonSerialize(); | 
| 47 | 47 | } | 
| @@ -97,7 +97,7 @@ discard block | ||
| 97 | 97 |      { | 
| 98 | 98 | // get the cert from the webserver and load it into an x509 phpseclib object | 
| 99 | 99 | $cert = $this->loadClientCertFromWebserver(); | 
| 100 | - // extract the UPN from the client cert | |
| 100 | + // extract the UPN from the client cert | |
| 101 | 101 | $upn = $this->getUserPrincipalNameFromClientCert($cert); | 
| 102 | 102 | // get the user if it exists | 
| 103 | 103 |          $user_class = config('enterpriseauth.user_class'); | 
| @@ -163,9 +163,9 @@ discard block | ||
| 163 | 163 |          if (count($groups)) { | 
| 164 | 164 | // remove the users existing database roles before assigning new ones | 
| 165 | 165 |              \DB::table('assigned_roles') | 
| 166 | -               ->where('entity_id', $user->id) | |
| 167 | -               ->where('entity_type', get_class($user)) | |
| 168 | - ->delete(); | |
| 166 | +                ->where('entity_id', $user->id) | |
| 167 | +                ->where('entity_type', get_class($user)) | |
| 168 | + ->delete(); | |
| 169 | 169 | // add the user to each group they are assigned | 
| 170 | 170 | $user->assign($groups); | 
| 171 | 171 | } | 
| @@ -49,7 +49,7 @@ discard block | ||
| 49 | 49 | public function scrubMicrosoftGraphUserData($userData) | 
| 50 | 50 |      { | 
| 51 | 51 | // Fix any stupid crap with missing or null fields | 
| 52 | -        if (! isset($userData['mail']) || ! $userData['mail']) { | |
| 52 | +        if (!isset($userData['mail']) || !$userData['mail']) { | |
| 53 | 53 | $userData['mail'] = $userData['userPrincipalName']; | 
| 54 | 54 | } | 
| 55 | 55 | |
| @@ -64,7 +64,7 @@ discard block | ||
| 64 | 64 | // Try to find an existing user | 
| 65 | 65 | $user = $userType::where($userIdField, $userData['id'])->first(); | 
| 66 | 66 | // If we dont have an existing user | 
| 67 | -        if (! $user) { | |
| 67 | +        if (!$user) { | |
| 68 | 68 | // Go create a new one with this data | 
| 69 | 69 | $user = $this->createUserFromAzureData($userData); | 
| 70 | 70 | } | 
| @@ -104,7 +104,7 @@ discard block | ||
| 104 | 104 | |
| 105 | 105 | // TODO: rewrite this so that if the user doesnt exist we create them and get their groups from AAD | 
| 106 | 106 |          $user = $user_class::where('userPrincipalName', $upn)->first(); | 
| 107 | -        if (! $user) { | |
| 107 | +        if (!$user) { | |
| 108 | 108 |              throw new \Exception('No user found with user principal name '.$upn); | 
| 109 | 109 | } | 
| 110 | 110 | |
| @@ -114,7 +114,7 @@ discard block | ||
| 114 | 114 | public function loadClientCertFromWebserver() | 
| 115 | 115 |      { | 
| 116 | 116 | // Make sure we got a client certificate from the web server | 
| 117 | -        if (! $_SERVER['SSL_CLIENT_CERT']) { | |
| 117 | +        if (!$_SERVER['SSL_CLIENT_CERT']) { | |
| 118 | 118 |              throw new \Exception('TLS client certificate missing'); | 
| 119 | 119 | } | 
| 120 | 120 | // try to parse the certificate we got | 
| @@ -128,7 +128,7 @@ discard block | ||
| 128 | 128 | public function getUserPrincipalNameFromClientCert($x509) | 
| 129 | 129 |      { | 
| 130 | 130 |          $names = $x509->getExtension('id-ce-subjectAltName'); | 
| 131 | -        if (! $names) { | |
| 131 | +        if (!$names) { | |
| 132 | 132 |              throw new \Exception('TLS client cert missing subject alternative names'); | 
| 133 | 133 | } | 
| 134 | 134 | // Search subject alt names for user principal name | 
| @@ -142,7 +142,7 @@ discard block | ||
| 142 | 142 | } | 
| 143 | 143 | } | 
| 144 | 144 | } | 
| 145 | -        if (! $upn) { | |
| 145 | +        if (!$upn) { | |
| 146 | 146 |              throw new \Exception('Could not find user principal name in TLS client cert'); | 
| 147 | 147 | } | 
| 148 | 148 | return $upn; |