protected function addButton($builder, $name, $config)
    {
        $options = isset($config['options']) ? $config['options'] : [];

        if (!in_array($config['type'], $this->allowedTypes)) {
            throw new \LogicException(sprintf(
                'Allowed button types : "%s", given "%s".',
                implode('", "', $this->allowedTypes),
                $config['type']
            ));
        }

        return $builder->add($name, $config['type'], $options);
    }
protected function addButton($builder, $name, $config)
    {
        $options = isset($config['options']) ? $config['options'] : [];

        if (!in_array($config['type'], $this->allowedTypes)) {
            throw new \LogicException(sprintf(
                'Allowed button types : "%s", given "%s".',
                implode('", "', $this->allowedTypes),
                $config['type']
            ));
        }

        return $builder->add($name, $config['type'], $options);
    }
protected function addButton ( $ builder , $ name , $ config ) { $ options = isset ( $ config [ 'options' ] ) ? $ config [ 'options' ] : [ ] ; if ( ! in_array ( $ config [ 'type' ] , $ this -> allowedTypes ) ) { throw new \ LogicException ( sprintf ( 'Allowed button types : "%s", given "%s".' , implode ( '", "' , $ this -> allowedTypes ) , $ config [ 'type' ] ) ) ; } return $ builder -> add ( $ name , $ config [ 'type' ] , $ options ) ; }
Adds a button.

@param FormBuilderInterface $builder
@param $name
@param $config

@throws \InvalidArgumentException

@return ButtonBuilder
Adds a button .