Code Duplication    Length = 11-13 lines in 2 locations

src/Forms/CheckboxSetField.php 1 location

@@ 108-120 (lines=13) @@
105
        return 'optionset checkboxset';
106
    }
107
108
    public function getAttributes()
109
    {
110
        $attributes = array_merge(
111
            parent::getAttributes(),
112
            array('role' => 'listbox')
113
        );
114
115
        // Remove invalid attributes from wrapper.
116
        unset($attributes['name']);
117
        unset($attributes['required']);
118
        unset($attributes['aria-required']);
119
        return $attributes;
120
    }
121
}
122

src/Forms/OptionsetField.php 1 location

@@ 149-159 (lines=11) @@
146
        return parent::validate($validator);
147
    }
148
149
    public function getAttributes()
150
    {
151
        $attributes = array_merge(
152
            parent::getAttributes(),
153
            array('role' => 'listbox')
154
        );
155
156
        unset($attributes['name']);
157
        unset($attributes['required']);
158
        return $attributes;
159
    }
160
}
161