Code Duplication    Length = 22-23 lines in 2 locations

includes/admin/tools/import/class-give-import-core-settings.php 1 location

@@ 106-127 (lines=22) @@
103
		 *
104
		 * @return void
105
		 */
106
		private function setup_hooks() {
107
			if ( ! $this->is_donations_import_page() ) {
108
				return;
109
			}
110
111
			// Do not render main import tools page.
112
			remove_action( 'give_admin_field_tools_import', array( 'Give_Settings_Import', 'render_import_field', ) );
113
114
			// Render donation import page
115
			add_action( 'give_admin_field_tools_import', array( $this, 'render_page' ) );
116
117
			// Print the HTML.
118
			add_action( 'give_tools_import_core_settings_form_start', array( $this, 'html' ), 10 );
119
120
			// Run when form submit.
121
			add_action( 'give-tools_save_import', array( $this, 'save' ) );
122
123
			add_action( 'give-tools_update_notices', array( $this, 'update_notices' ), 11, 1 );
124
125
			// Used to add submit button.
126
			add_action( 'give_tools_import_core_settings_form_end', array( $this, 'submit' ), 10 );
127
		}
128
129
		/**
130
		 * Update notice

includes/admin/tools/import/class-give-import-donations.php 1 location

@@ 107-129 (lines=23) @@
104
		 *
105
		 * @return void
106
		 */
107
		private function setup_hooks() {
108
			if ( ! $this->is_donations_import_page() ) {
109
				return;
110
			}
111
112
			// Do not render main import tools page.
113
			remove_action( 'give_admin_field_tools_import', array( 'Give_Settings_Import', 'render_import_field', ) );
114
115
116
			// Render donation import page
117
			add_action( 'give_admin_field_tools_import', array( $this, 'render_page' ) );
118
119
			// Print the HTML.
120
			add_action( 'give_tools_import_donations_form_start', array( $this, 'html' ), 10 );
121
122
			// Run when form submit.
123
			add_action( 'give-tools_save_import', array( $this, 'save' ) );
124
125
			add_action( 'give-tools_update_notices', array( $this, 'update_notices' ), 11, 1 );
126
127
			// Used to add submit button.
128
			add_action( 'give_tools_import_donations_form_end', array( $this, 'submit' ), 10 );
129
		}
130
131
		/**
132
		 * Update notice