Group the security identities definition.

@param SecurityIdentityInterface[] $sids The security identities

@return array
482374
private function groupSecurityIdentities(array $sids)
    {
        $groupSids = [];

        if (null === $this->sharingManager) {
            throw new InvalidArgumentException('The "setSharingManager()" must be called before');
        }

        foreach ($sids as $sid) {
            if (IdentityUtils::isValid($sid)) {
                $type = $this->sharingManager->getIdentityConfig($sid->getType())->getType();
                $groupSids[$type][] = $sid->getIdentifier();
            }
        }

        return $groupSids;
    }
471889
protected static function getOrganizationGroups(OrganizationUserInterface $user)
    {
        $sids = [];
        $orgName = $user->getOrganization()->getName();

        if ($user instanceof GroupableInterface) {
            foreach ($user->getGroups() as $group) {
                if ($group instanceof GroupInterface) {
                    $sids[] = new GroupSecurityIdentity(ClassUtils::getClass($group), $group->getName().'__'.$orgName);
                }
            }
        }

        return $sids;
    }
525744
private function groupIdsByFile(array $ids) : array
    {
        $covered = [];

        foreach ($ids as $id) {
            $file = mb_substr($id, 0, (int) mb_strpos($id, '::'));

            if (!isset($covered[$file])) {
                $covered[$file] = [];
            }

            $covered[$file][] = mb_substr($id, mb_strpos($id, '::') + 2);
        }

        return $covered;
    }
428584
public function getContext($sid) {
        return new IpAccessControlListMappingContext(
            $this->version,
            $this->solution['accountSid'],
            $this->solution['domainSid'],
            $sid
        );
    }
687855
public function getContext($sid) {
        return new ChallengeContext(
            $this->version,
            $this->solution['serviceSid'],
            $this->solution['identity'],
            $this->solution['factorSid'],
            $sid
        );
    }
376944
public function singleton($params = [])
    {
        static $instances = [];

        $signature = serialize($params);
        if (!isset($instances[$signature])) {
            $instances[$signature] = idna_convert::getInstance($params);
        }

        return $instances[$signature];
    }
800677
public function getGroups(IdentityRequest $request) {
    $identity = new Identity();
    $this->setRequestUrl('/identity/groups');
    $this->setRequestObject($request);
    $this->setRequestMethod('GET');

    try {
      return $identity->cast($this->execute());
    } catch (Exception $e) {
      throw $e;
    }
  }
929575
public function getContext($sid) {
        return new NotificationContext(
            $this->version,
            $this->solution['accountSid'],
            $this->solution['callSid'],
            $sid
        );
    }
1310244
protected function getIds( $request )
	{
		$ids = [];

		if( isset( $request->data ) )
		{
			foreach( (array) $request->data as $entry )
			{
				if( isset( $entry->id ) ) {
					$ids[] = $entry->id;
				}
			}
		}

		return $ids;
	}
139831
public function block($ids): array
    {
        $ids = $this->mergeBlcokedAt((array) $ids);

        return $this->blockingUsers()->syncWithoutDetaching($ids);
    }
1237116
public function getContext($sid) {
        return new AuthCallsIpAccessControlListMappingContext(
            $this->version,
            $this->solution['accountSid'],
            $this->solution['domainSid'],
            $sid
        );
    }
216386
public static function getGroupIdName($users)
	{
		$users = explode(",", $users);
		$usersArray = array();
		foreach ($users as $user)
		{
			$user = User::find($user);
			if ($user)
				$usersArray[] = array('name' => $user->name, 'user_id' => $user->user_id);
		}
		return $usersArray;
	}
343178
public function findAllIdentifiers(): array
    {
        $queryBuilder = $this->createQuery();
        $rows = $queryBuilder->select('identifier')
            ->from($this->getTableName())
            ->groupBy('identifier')
            ->execute()
            ->fetchAll();

        $cacheIdentifiers = [];
        foreach ($rows as $row) {
            $cacheIdentifiers[] = $row['identifier'];
        }

        return $cacheIdentifiers;
    }
507739
protected function addCurrentUser(TokenInterface $token, array $sids)
    {
        if (!$token instanceof AnonymousToken) {
            try {
                $sids[] = UserSecurityIdentity::fromToken($token);
            } catch (\InvalidArgumentException $e) {
                // ignore, user has no user security identity
            }
        }

        return $sids;
    }
733448
private function getObjectStateGroupsIds(array $groups): array
    {
        $groupsIds = array_column($groups, 'id');

        return array_combine($groupsIds, array_fill_keys($groupsIds, false));
    }
13391
public function getContext($sid) {
        return new MessageInteractionContext(
            $this->version,
            $this->solution['serviceSid'],
            $this->solution['sessionSid'],
            $this->solution['participantSid'],
            $sid
        );
    }
426386
public static function isValid(SecurityIdentityInterface $sid)
    {
        return !$sid instanceof RoleSecurityIdentity
            || ($sid instanceof RoleSecurityIdentity && false === strpos($sid->getIdentifier(), 'IS_'));
    }