public static TextFormat::processFormat(&$element, FormStateInterface $form_state, &$complete_form)
Expands an element into a base element with text format selector attached.
The form element will be expanded into two separate form elements, one holding the original element, and the other holding the text format selector:
value: Holds the original element, having its #type changed to the value of #base_type or 'textarea' by default.
format: Holds the text format details and the text f