Replacing these two lines with `$documents = array_values($paginationAdapter->getItems(0, 5));` will minimize the diff, keeping the for loop as-is.