Code Duplication    Length = 11-11 lines in 3 locations

core/services/request/files/FilesDataHandler.php 3 locations

@@ 117-127 (lines=11) @@
114
     */
115
    protected function isStrangeFilesArray($files_data)
116
    {
117
        if (!is_array($files_data)) {
118
            throw new UnexpectedValueException(
119
                sprintf(
120
                    esc_html__(
121
                        'Unexpected PHP $_FILES data format. "%1$s" was expected to be an array.',
122
                        'event_espresso'
123
                    ),
124
                    (string) $files_data
125
                )
126
            );
127
        }
128
        $first_value = reset($files_data);
129
        if (!is_array($first_value)) {
130
            throw new UnexpectedValueException(
@@ 129-139 (lines=11) @@
126
            );
127
        }
128
        $first_value = reset($files_data);
129
        if (!is_array($first_value)) {
130
            throw new UnexpectedValueException(
131
                sprintf(
132
                    esc_html__(
133
                        'Unexpected PHP $_FILES data format. "%1$s" was expected to be an array.',
134
                        'event_espresso'
135
                    ),
136
                    (string) $first_value
137
                )
138
            );
139
        }
140
        $first_sub_array_item = reset($first_value);
141
        if (is_array($first_sub_array_item)) {
142
            // not just a 2d array
@@ 211-221 (lines=11) @@
208
     */
209
    protected function createFileObjects($organized_files, $name_parts_so_far = [])
210
    {
211
        if (!is_array($organized_files)) {
212
            throw new UnexpectedValueException(
213
                sprintf(
214
                    esc_html__(
215
                        'Unexpected PHP $organized_files data format. "%1$s" was expected to be an array.',
216
                        'event_espresso'
217
                    ),
218
                    (string) $organized_files
219
                )
220
            );
221
        }
222
        foreach ($organized_files as $key => $value) {
223
            array_push(
224
                $name_parts_so_far,