Code Duplication    Length = 19-20 lines in 2 locations

packages/sync/src/modules/Users.php 2 locations

@@ 247-266 (lines=20) @@
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
		$this->clear_flags( $user_id );
265
266
	}
267
268
	function add_user_to_blog_handler( $user_id, $old_user_data = null ) {
269
		// ensure we only sync users who are members of the current blog
@@ 268-286 (lines=19) @@
265
266
	}
267
268
	function add_user_to_blog_handler( $user_id, $old_user_data = null ) {
269
		// ensure we only sync users who are members of the current blog
270
		if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) {
271
			return;
272
		}
273
274
		if ( Jetpack_Constants::is_true( 'JETPACK_INVITE_ACCEPTED' ) ) {
275
			$this->add_flags( $user_id, array( 'invitation_accepted' => true ) );
276
		}
277
		/**
278
		 * Fires when a user is added on a site
279
		 *
280
		 * @since 4.9.0
281
		 *
282
		 * @param object The WP_User object
283
		 */
284
		do_action( 'jetpack_sync_add_user', $user_id, $this->get_flags( $user_id ) );
285
		$this->clear_flags( $user_id );
286
	}
287
288
	function save_user_handler( $user_id, $old_user_data = null ) {
289
		// ensure we only sync users who are members of the current blog