Identity/GroupSecurityIdentity.php
public static function fromToken(TokenInterface $token)
    {
        $user = $token->getUser();

        if ($user instanceof GroupableInterface) {
            $sids = [];
            $groups = $user->getGroups();

            foreach ($groups as $group) {
                $sids[] = self::fromAccount($group);
            }

            return $sids;
        }

        throw new InvalidArgumentException('The user class must implement "Fxp\Component\Security\Model\Traits\GroupableInterface"');
    }
public static function fromToken(TokenInterface $token)
    {
        $user = $token->getUser();

        if ($user instanceof GroupableInterface) {
            $sids = [];
            $groups = $user->getGroups();

            foreach ($groups as $group) {
                $sids[] = self::fromAccount($group);
            }

            return $sids;
        }

        throw new InvalidArgumentException('The user class must implement "Fxp\Component\Security\Model\Traits\GroupableInterface"');
    }
public static function fromToken ( TokenInterface $ token ) { $ user = $ token -> getUser ( ) ; if ( $ user instanceof GroupableInterface ) { $ sids = [ ] ; $ groups = $ user -> getGroups ( ) ; foreach ( $ groups as $ group ) { $ sids [ ] = self :: fromAccount ( $ group ) ; } return $ sids ; } throw new InvalidArgumentException ( 'The user class must implement "Fxp\Component\Security\Model\Traits\GroupableInterface"' ) ; }
Creates a group security identity from a TokenInterface.

@param TokenInterface $token The token

@throws InvalidArgumentException When the user class not implements "Fxp\Component\Security\Model\Traits\GroupableInterface"

@return self[]
Creates a group security identity from a TokenInterface .