protected static function extractAjaxFormatter($form)
    {
        $form = static::getForm($form);
        $formatter = $form->getAttribute('select2', $form->getOption('select2'));
        $formatter = $formatter['ajax_formatter'];

        if (!$formatter instanceof AjaxChoiceListFormatterInterface) {
            throw new UnexpectedTypeException($formatter, 'Fxp\Component\FormExtensions\Form\ChoiceList\Formatter\AjaxChoiceListFormatterInterface');
        }

        return $formatter;
    }
protected static function extractAjaxFormatter($form)
    {
        $form = static::getForm($form);
        $formatter = $form->getAttribute('select2', $form->getOption('select2'));
        $formatter = $formatter['ajax_formatter'];

        if (!$formatter instanceof AjaxChoiceListFormatterInterface) {
            throw new UnexpectedTypeException($formatter, 'Fxp\Component\FormExtensions\Form\ChoiceList\Formatter\AjaxChoiceListFormatterInterface');
        }

        return $formatter;
    }
protected static function extractAjaxFormatter ( $ form ) { $ form = static :: getForm ( $ form ) ; $ formatter = $ form -> getAttribute ( 'select2' , $ form -> getOption ( 'select2' ) ) ; $ formatter = $ formatter [ 'ajax_formatter' ] ; if ( ! $ formatter instanceof AjaxChoiceListFormatterInterface ) { throw new UnexpectedTypeException ( $ formatter , 'Fxp\Component\FormExtensions\Form\ChoiceList\Formatter\AjaxChoiceListFormatterInterface' ) ; } return $ formatter ; }
Extracts the ajax formatter.

@param FormBuilderInterface|FormInterface $form

@return AjaxChoiceListFormatterInterface

@throws InvalidArgumentException When the ajax_formatter is not an instance of AjaxChoiceListFormatterInterface
Extracts the ajax formatter .