original_string: public function addChoice(\DOMElement $node)
      {
          if (!$this->multiple && 'radio' !== $this->type) {
              throw new \LogicException(sprintf('Unable to add a choice for "%s" as it is not multiple or is not a radio button.', $this->name));
          }
  
          $option = $this->buildOptionValue($node);
          $this->options[] = $option;
  
          if ($node->hasAttribute('checked')) {
              $this->value = $option['value'];
          }
      }
code: public function addChoice(\DOMElement $node)
      {
          if (!$this->multiple && 'radio' !== $this->type) {
              throw new \LogicException(sprintf('Unable to add a choice for "%s" as it is not multiple or is not a radio button.', $this->name));
          }
  
          $option = $this->buildOptionValue($node);
          $this->options[] = $option;
  
          if ($node->hasAttribute('checked')) {
              $this->value = $option['value'];
          }
      }
code_tokens: public function addChoice ( \ DOMElement $ node ) { if ( ! $ this -> multiple && 'radio' !== $ this -> type ) { throw new \ LogicException ( sprintf ( 'Unable to add a choice for "%s" as it is not multiple or is not a radio button.' , $ this -> name ) ) ; } $ option = $ this -> buildOptionValue ( $ node ) ; $ this -> options [ ] = $ option ; if ( $ node -> hasAttribute ( 'checked' ) ) { $ this -> value = $ option [ 'value' ] ; } }
docstring: Adds a choice to the current ones.
  
  @param \DOMElement $node
  
  @throws \LogicException When choice provided is not multiple nor radio
  
  @internal
docstring_tokens: Adds a choice to the current ones .