original_string: protected function attachRefreshToken(UserInterface $user)
      {
          $refreshTokenManager = $this->container->get('gesdinet.jwtrefreshtoken.refresh_token_manager');
          $refreshToken = $refreshTokenManager->getLastFromUsername($user->getUsername());
          $refreshTokenTtl = $this->container->getParameter('gesdinet_jwt_refresh_token.ttl');
  
          if (!$refreshToken instanceof RefreshToken) {
              $refreshToken = $refreshTokenManager->create();
              $expirationDate = new \DateTime();
              $expirationDate->modify(sprintf('+%s seconds', $refreshTokenTtl));
              $refreshToken->setUsername($user->getUsername());
              $refreshToken->setRefreshToken();
              $refreshToken->setValid($expirationDate);
  
              $refreshTokenManager->save($refreshToken);
          }
  
          return $refreshToken->getRefreshToken();
      }
code: protected function attachRefreshToken(UserInterface $user)
      {
          $refreshTokenManager = $this->container->get('gesdinet.jwtrefreshtoken.refresh_token_manager');
          $refreshToken = $refreshTokenManager->getLastFromUsername($user->getUsername());
          $refreshTokenTtl = $this->container->getParameter('gesdinet_jwt_refresh_token.ttl');
  
          if (!$refreshToken instanceof RefreshToken) {
              $refreshToken = $refreshTokenManager->create();
              $expirationDate = new \DateTime();
              $expirationDate->modify(sprintf('+%s seconds', $refreshTokenTtl));
              $refreshToken->setUsername($user->getUsername());
              $refreshToken->setRefreshToken();
              $refreshToken->setValid($expirationDate);
  
              $refreshTokenManager->save($refreshToken);
          }
  
          return $refreshToken->getRefreshToken();
      }
code_tokens: protected function attachRefreshToken ( UserInterface $ user ) { $ refreshTokenManager = $ this -> container -> get ( 'gesdinet.jwtrefreshtoken.refresh_token_manager' ) ; $ refreshToken = $ refreshTokenManager -> getLastFromUsername ( $ user -> getUsername ( ) ) ; $ refreshTokenTtl = $ this -> container -> getParameter ( 'gesdinet_jwt_refresh_token.ttl' ) ; if ( ! $ refreshToken instanceof RefreshToken ) { $ refreshToken = $ refreshTokenManager -> create ( ) ; $ expirationDate = new \ DateTime ( ) ; $ expirationDate -> modify ( sprintf ( '+%s seconds' , $ refreshTokenTtl ) ) ; $ refreshToken -> setUsername ( $ user -> getUsername ( ) ) ; $ refreshToken -> setRefreshToken ( ) ; $ refreshToken -> setValid ( $ expirationDate ) ; $ refreshTokenManager -> save ( $ refreshToken ) ; } return $ refreshToken -> getRefreshToken ( ) ; }
docstring: Provides a refresh token.
  
  @param UserInterface $user
  
  @return string The refresh Json Web Token.
docstring_tokens: Provides a refresh token .