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

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