Code Duplication    Length = 13-14 lines in 2 locations

packages/debug-helper/modules/class-broken-token.php 2 locations

@@ 303-316 (lines=14) @@
300
	/**
301
	 * Set invalid user token.
302
	 */
303
	public function admin_post_set_invalid_user_tokens() {
304
		check_admin_referer( 'set-invalid-user-tokens' );
305
		$this->notice_type = 'jetpack-broken';
306
307
		$new_tokens = array();
308
309
		foreach ( Jetpack_Options::get_option( 'user_tokens' ) as $id => $token ) {
310
			$new_tokens[ $id ] = sprintf( $this->invalid_user_token, $id );
311
		}
312
313
		Jetpack_Options::update_option( 'user_tokens', $new_tokens );
314
315
		$this->admin_post_redirect_referrer();
316
	}
317
318
	/**
319
	 * Set invalid current user token.
@@ 321-333 (lines=13) @@
318
	/**
319
	 * Set invalid current user token.
320
	 */
321
	public function admin_post_set_invalid_current_user_token() {
322
		check_admin_referer( 'set-invalid-current-user-token' );
323
		$this->notice_type = 'jetpack-broken';
324
325
		$tokens = Jetpack_Options::get_option( 'user_tokens' );
326
327
		$id            = get_current_user_id();
328
		$tokens[ $id ] = sprintf( $this->invalid_user_token, $id );
329
330
		Jetpack_Options::update_option( 'user_tokens', $tokens );
331
332
		$this->admin_post_redirect_referrer();
333
	}
334
335
	/**
336
	 * Clear blog token.