original_string: protected function prepareTokenResponse(
          AccessToken $accessToken,
          RefreshToken $refreshToken = null,
          bool $useRefreshTokenScopes = false
      ): ResponseInterface {
          $owner = $accessToken->getOwner();
          $scopes = $useRefreshTokenScopes ? $refreshToken->getScopes() : $accessToken->getScopes();
  
          $responseBody = [
              'access_token' => $accessToken->getToken(),
              'token_type' => 'Bearer',
              'expires_in' => $accessToken->getExpiresIn(),
              'scope' => implode(' ', $scopes),
              'owner_id' => $owner ? $owner->getTokenOwnerId() : null,
          ];
  
          if (null !== $refreshToken) {
              $responseBody['refresh_token'] = $refreshToken->getToken();
          }
  
          return new Response\JsonResponse(array_filter($responseBody));
      }
code: protected function prepareTokenResponse(
          AccessToken $accessToken,
          RefreshToken $refreshToken = null,
          bool $useRefreshTokenScopes = false
      ): ResponseInterface {
          $owner = $accessToken->getOwner();
          $scopes = $useRefreshTokenScopes ? $refreshToken->getScopes() : $accessToken->getScopes();
  
          $responseBody = [
              'access_token' => $accessToken->getToken(),
              'token_type' => 'Bearer',
              'expires_in' => $accessToken->getExpiresIn(),
              'scope' => implode(' ', $scopes),
              'owner_id' => $owner ? $owner->getTokenOwnerId() : null,
          ];
  
          if (null !== $refreshToken) {
              $responseBody['refresh_token'] = $refreshToken->getToken();
          }
  
          return new Response\JsonResponse(array_filter($responseBody));
      }
code_tokens: protected function prepareTokenResponse ( AccessToken $ accessToken , RefreshToken $ refreshToken = null , bool $ useRefreshTokenScopes = false ) : ResponseInterface { $ owner = $ accessToken -> getOwner ( ) ; $ scopes = $ useRefreshTokenScopes ? $ refreshToken -> getScopes ( ) : $ accessToken -> getScopes ( ) ; $ responseBody = [ 'access_token' => $ accessToken -> getToken ( ) , 'token_type' => 'Bearer' , 'expires_in' => $ accessToken -> getExpiresIn ( ) , 'scope' => implode ( ' ' , $ scopes ) , 'owner_id' => $ owner ? $ owner -> getTokenOwnerId ( ) : null , ] ; if ( null !== $ refreshToken ) { $ responseBody [ 'refresh_token' ] = $ refreshToken -> getToken ( ) ; } return new Response \ JsonResponse ( array_filter ( $ responseBody ) ) ; }
docstring: Prepare the actual HttpResponse for the token
docstring_tokens: Prepare the actual HttpResponse for the token