public function createTokenRequest(User $user, $issuer)
    {
        $idAttribution = $user->getCurrentAttribution() ? $user->getCurrentAttribution()->getId() : null;

        return (new TokenRequest())
            ->setUsername($user->getUserName())
            ->setAttributionId($idAttribution)
            ->setIssuer($issuer);
    }
public function createTokenRequest(User $user, $issuer)
    {
        $idAttribution = $user->getCurrentAttribution() ? $user->getCurrentAttribution()->getId() : null;

        return (new TokenRequest())
            ->setUsername($user->getUserName())
            ->setAttributionId($idAttribution)
            ->setIssuer($issuer);
    }
public function createTokenRequest ( User $ user , $ issuer ) { $ idAttribution = $ user -> getCurrentAttribution ( ) ? $ user -> getCurrentAttribution ( ) -> getId ( ) : null ; return ( new TokenRequest ( ) ) -> setUsername ( $ user -> getUserName ( ) ) -> setAttributionId ( $ idAttribution ) -> setIssuer ( $ issuer ) ; }
Create a request for a token with an User entity

@param User   $user
@param string $issuer

@return TokenRequest
Create a request for a token with an User entity