Code Duplication    Length = 6-6 lines in 2 locations

admin_pages/events/Events_Admin_Page.core.php 1 location

@@ 2216-2221 (lines=6) @@
2213
        $deletion_data = get_option('ee_deletion_' . $deletion_job_code, []);
2214
2215
        $models_and_ids_to_delete = [];
2216
        foreach ($deletion_data as $root) {
2217
            if (! $root instanceof ModelObjNode) {
2218
                throw new UnexpectedEntityException($root, 'ModelObjNode');
2219
            }
2220
            $models_and_ids_to_delete = array_replace_recursive($models_and_ids_to_delete, $root->getIds());
2221
        }
2222
        return $models_and_ids_to_delete;
2223
    }
2224

core/libraries/batch/JobHandlers/ExecuteBatchDeletion.php 1 location

@@ 45-50 (lines=6) @@
42
            throw new UnexpectedEntityException($roots, 'array', esc_html__('The job seems to be stale. Please press the back button in your browser twice.', 'event_espresso'));
43
        }
44
        $models_and_ids_to_delete = [];
45
        foreach ($roots as $root) {
46
            if (! $root instanceof ModelObjNode) {
47
                throw new UnexpectedEntityException($root, 'ModelObjNode');
48
            }
49
            $models_and_ids_to_delete = array_replace_recursive($models_and_ids_to_delete, $root->getIds());
50
        }
51
        $job_parameters->set_extra_data(
52
            [
53
                'models_and_ids_to_delete' => $models_and_ids_to_delete