src/Forms/FieldList.php
protected function fieldNameError(FormField $field, $functionName)
    {
        if ($this->form) {
            $errorSuffix = sprintf(
                " in your '%s' form called '%s'",
                get_class($this->form),
                $this->form->getName()
            );
        } else {
            $errorSuffix = '';
        }

        user_error(
            sprintf(
                "%s() I noticed that a field called '%s' appears twice%s",
                $functionName,
                $field->getName(),
                $errorSuffix
            ),
            E_USER_ERROR
        );
    }
protected function fieldNameError(FormField $field, $functionName)
    {
        if ($this->form) {
            $errorSuffix = sprintf(
                " in your '%s' form called '%s'",
                get_class($this->form),
                $this->form->getName()
            );
        } else {
            $errorSuffix = '';
        }

        user_error(
            sprintf(
                "%s() I noticed that a field called '%s' appears twice%s",
                $functionName,
                $field->getName(),
                $errorSuffix
            ),
            E_USER_ERROR
        );
    }
protected function fieldNameError ( FormField $ field , $ functionName ) { if ( $ this -> form ) { $ errorSuffix = sprintf ( " in your '%s' form called '%s'" , get_class ( $ this -> form ) , $ this -> form -> getName ( ) ) ; } else { $ errorSuffix = '' ; } user_error ( sprintf ( "%s() I noticed that a field called '%s' appears twice%s" , $ functionName , $ field -> getName ( ) , $ errorSuffix ) , E_USER_ERROR ) ; }
Trigger an error for duplicate field names

@param FormField $field
@param $functionName
Trigger an error for duplicate field names