Code Duplication    Length = 9-12 lines in 2 locations

includes/admin/settings/class-wc-settings-api.php 1 location

@@ 94-105 (lines=12) @@
91
	public function form_method( $method ) {
92
		global $current_section;
93
94
		if ( 'webhooks' == $current_section ) {
95
			if ( isset( $_GET['edit-webhook'] ) ) {
96
				$webhook_id = absint( $_GET['edit-webhook'] );
97
				$webhook    = new WC_Webhook( $webhook_id );
98
99
				if ( 'trash' != $webhook->post_data->post_status ) {
100
					return 'post';
101
				}
102
			}
103
104
			return 'get';
105
		}
106
107
		if ( 'keys' == $current_section ) {
108
			if ( isset( $_GET['create-key'] ) || isset( $_GET['edit-key'] ) ) {

includes/admin/class-wc-admin-webhooks.php 1 location

@@ 354-362 (lines=9) @@
351
		// Hide the save button
352
		$GLOBALS['hide_save_button'] = true;
353
354
		if ( isset( $_GET['edit-webhook'] ) ) {
355
			$webhook_id = absint( $_GET['edit-webhook'] );
356
			$webhook    = new WC_Webhook( $webhook_id );
357
358
			if ( 'trash' != $webhook->post_data->post_status ) {
359
				include( 'settings/views/html-webhooks-edit.php' );
360
				return;
361
			}
362
		}
363
364
		self::table_list_output();
365
	}