How do I add a class to the search block form?
You can use the template_preprocess_form

function THEMENAME_preprocess_form(&amp;$vars) {
  // Add class to your specific form
  if ($vars['attributes']['id'] == 'search-block-form') {
    $vars['attributes']['class'][] = 'form-inline ';
  }
}


NOTE: the preprocessor you are using adds class to the block element