1# frozen_string_literal: true 2 3module Gitlab 4 # This class has the same interface as SearchResults except 5 # it is empty and does not do any work. 6 # 7 # We use this when responding to abusive search requests. 8 class EmptySearchResults 9 def initialize(*) 10 end 11 12 def objects(*) 13 Kaminari.paginate_array([]) 14 end 15 16 def formatted_count(*) 17 '0' 18 end 19 20 def highlight_map(*) 21 {} 22 end 23 24 def aggregations(*) 25 [] 26 end 27 end 28end 29