Code Duplication    Length = 18-19 lines in 2 locations

sync/class.jetpack-sync-module-users.php 2 locations

@@ 247-265 (lines=19) @@
244
		do_action( 'jetpack_deleted_user', $deleted_user_id, $reassigned_user_id, $is_multisite );
245
	}
246
247
	function user_register_handler( $user_id, $old_user_data = null ) {
248
		// ensure we only sync users who are members of the current blog
249
		if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) {
250
			return;
251
		}
252
253
		if ( Jetpack_Constants::is_true( 'JETPACK_INVITE_ACCEPTED' ) ) {
254
			$this->add_flags( $user_id, array( 'invitation_accepted' => true ) );
255
		}
256
		/**
257
		 * Fires when a new user is registered on a site
258
		 *
259
		 * @since 4.9.0
260
		 *
261
		 * @param object The WP_User object
262
		 */
263
		do_action( 'jetpack_sync_register_user', $user_id, $this->get_flags( $user_id ) );
264
265
	}
266
267
	function add_user_to_blog_handler( $user_id, $old_user_data = null ) {
268
		// ensure we only sync users who are members of the current blog
@@ 267-284 (lines=18) @@
264
265
	}
266
267
	function add_user_to_blog_handler( $user_id, $old_user_data = null ) {
268
		// ensure we only sync users who are members of the current blog
269
		if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) {
270
			return;
271
		}
272
273
		if ( Jetpack_Constants::is_true( 'JETPACK_INVITE_ACCEPTED' ) ) {
274
			$this->add_flags( $user_id, array( 'invitation_accepted' => true ) );
275
		}
276
		/**
277
		 * Fires when a user is added on a site
278
		 *
279
		 * @since 4.9.0
280
		 *
281
		 * @param object The WP_User object
282
		 */
283
		do_action( 'jetpack_sync_add_user', $user_id, $this->get_flags( $user_id ) );
284
	}
285
286
	function save_user_handler( $user_id, $old_user_data = null ) {
287
		// ensure we only sync users who are members of the current blog