src/Response/Response.php
private function convertToCustomField($field)
    {
        if (!empty($field->attributes())) {
            if (isset($field->attributes()->{'field-name'}) && isset($field->attributes()->{'field-value'})) {
                $rawName = (string)$field->attributes()->{'field-name'};
                list($normalizedName, $prefix) = $this->splitFieldNameAndPrefix($rawName);
                $value = (string)$field->attributes()->{'field-value'};
                if (!empty($normalizedName)) {
                    return new CustomField($normalizedName, $value, $prefix);
                }
            }
        }
        return null;
    }
private function convertToCustomField($field)
    {
        if (!empty($field->attributes())) {
            if (isset($field->attributes()->{'field-name'}) && isset($field->attributes()->{'field-value'})) {
                $rawName = (string)$field->attributes()->{'field-name'};
                list($normalizedName, $prefix) = $this->splitFieldNameAndPrefix($rawName);
                $value = (string)$field->attributes()->{'field-value'};
                if (!empty($normalizedName)) {
                    return new CustomField($normalizedName, $value, $prefix);
                }
            }
        }
        return null;
    }
private function convertToCustomField ( $ field ) { if ( ! empty ( $ field -> attributes ( ) ) ) { if ( isset ( $ field -> attributes ( ) -> { 'field-name' } ) && isset ( $ field -> attributes ( ) -> { 'field-value' } ) ) { $ rawName = ( string ) $ field -> attributes ( ) -> { 'field-name' } ; list ( $ normalizedName , $ prefix ) = $ this -> splitFieldNameAndPrefix ( $ rawName ) ; $ value = ( string ) $ field -> attributes ( ) -> { 'field-value' } ; if ( ! empty ( $ normalizedName ) ) { return new CustomField ( $ normalizedName , $ value , $ prefix ) ; } } } return null ; }
Convert the xml field into a CustomField object

Return null if field name is empty or xml object does not provides field name/field value as attribute

@param SimpleXMLElement $field
@return null|CustomField
Convert the xml field into a CustomField object