diff --git a/plugin/azure_active_directory/src/AzureActiveDirectory.php b/plugin/azure_active_directory/src/AzureActiveDirectory.php index 9a05cbfa7e..f3467cebea 100644 --- a/plugin/azure_active_directory/src/AzureActiveDirectory.php +++ b/plugin/azure_active_directory/src/AzureActiveDirectory.php @@ -180,7 +180,8 @@ class AzureActiveDirectory extends Plugin return $defaultOrder; } - public function getUserIdByVerificationOrder(array $azureUserData, string $azureUidKey = 'objectId'): ?int { + public function getUserIdByVerificationOrder(array $azureUserData, string $azureUidKey = 'objectId'): ?int + { $selectedOrder = $this->getExistingUserVerificationOrder(); $extraFieldValue = new ExtraFieldValue('user'); @@ -228,7 +229,7 @@ class AzureActiveDirectory extends Plugin if (empty($userId)) { // If we didn't find the user if ($this->get(self::SETTING_PROVISION_USERS) !== 'true') { - throw new Exception('User not found when checking the extra fields from ' . $azureUserInfo['mail'] . ' or ' . $azureUserInfo['mailNickname'] . ' or ' . $azureUserInfo[$azureUidKey] . '.'); + throw new Exception('User not found when checking the extra fields from '.$azureUserInfo['mail'].' or '.$azureUserInfo['mailNickname'].' or '.$azureUserInfo[$azureUidKey].'.'); } [ @@ -267,7 +268,7 @@ class AzureActiveDirectory extends Plugin ); if (!$userId) { - throw new Exception(get_lang('UserNotAdded') . ' ' . $azureUserInfo['userPrincipalName']); + throw new Exception(get_lang('UserNotAdded').' '.$azureUserInfo['userPrincipalName']); } return $userId; @@ -333,9 +334,7 @@ class AzureActiveDirectory extends Plugin $groupObjectIdKey ); } catch (Exception $e) { - throw new Exception( - 'Exception when formatting user '.$azureUserInfo[$azureUidKey].' data: '.$e->getMessage() - ); + throw new Exception('Exception when formatting user '.$azureUserInfo[$azureUidKey].' data: '.$e->getMessage()); } $phone = null; diff --git a/plugin/azure_active_directory/src/AzureSyncUsergroupsCommand.php b/plugin/azure_active_directory/src/AzureSyncUsergroupsCommand.php index 9102c9d82c..6677683596 100644 --- a/plugin/azure_active_directory/src/AzureSyncUsergroupsCommand.php +++ b/plugin/azure_active_directory/src/AzureSyncUsergroupsCommand.php @@ -7,8 +7,9 @@ use League\OAuth2\Client\Token\AccessTokenInterface; class AzureSyncUsergroupsCommand extends AzureCommand { /** - * @return Generator * @throws Exception + * + * @return Generator */ public function __invoke(): Generator { @@ -60,8 +61,9 @@ class AzureSyncUsergroupsCommand extends AzureCommand } /** - * @return Generator> * @throws Exception + * + * @return Generator> */ private function getAzureGroups(AccessTokenInterface $token): Generator { @@ -96,19 +98,20 @@ class AzureSyncUsergroupsCommand extends AzureCommand $hasNextLink = true; $query = parse_url($azureGroupsRequest['@odata.nextLink'], PHP_URL_QUERY); } - } while($hasNextLink); + } while ($hasNextLink); } /** - * @return Generator> * @throws Exception + * + * @return Generator> */ private function getAzureGroupMembers(AccessTokenInterface $token, string $groupObjectId): Generator { $userFields = [ 'mail', 'mailNickname', - 'id' + 'id', ]; $query = sprintf( '$top=%d&$select=%s', diff --git a/plugin/azure_active_directory/src/AzureSyncUsersCommand.php b/plugin/azure_active_directory/src/AzureSyncUsersCommand.php index 826c22eb3b..3e3cf3b11a 100644 --- a/plugin/azure_active_directory/src/AzureSyncUsersCommand.php +++ b/plugin/azure_active_directory/src/AzureSyncUsersCommand.php @@ -7,8 +7,9 @@ use League\OAuth2\Client\Token\AccessTokenInterface; class AzureSyncUsersCommand extends AzureCommand { /** - * @return Generator * @throws Exception + * + * @return Generator */ public function __invoke(): Generator { @@ -27,7 +28,7 @@ class AzureSyncUsersCommand extends AzureCommand $token, $this->provider, $azureUserInfo, - 'users/' . $azureUserInfo['id'] . '/memberOf', + 'users/'.$azureUserInfo['id'].'/memberOf', 'id', 'id' ); @@ -69,8 +70,9 @@ class AzureSyncUsersCommand extends AzureCommand } /** - * @return Generator> * @throws Exception + * + * @return Generator> */ private function getAzureUsers(AccessTokenInterface $token): Generator { @@ -83,7 +85,7 @@ class AzureSyncUsersCommand extends AzureCommand 'mobilePhone', 'accountEnabled', 'mailNickname', - 'id' + 'id', ]; $query = sprintf(