original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: Adds a button.
  
  @param FormBuilderInterface $builder
  @param $name
  @param $config
  
  @throws \InvalidArgumentException
  
  @return ButtonBuilder
docstring_tokens: Adds a button .