Code Duplication    Length = 18-19 lines in 2 locations

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

@@ 189-207 (lines=19) @@
186
		do_action( 'jetpack_deleted_user', $deleted_user_id, $reassigned_user_id, $is_multisite );
187
	}
188
189
	function user_register_handler( $user_id, $old_user_data = null ) {
190
		// ensure we only sync users who are members of the current blog
191
		if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) {
192
			return;
193
		}
194
195
		if ( Jetpack_Constants::is_true( 'JETPACK_INVITE_ACCEPTED' ) ) {
196
			$this->add_flags( $user_id, array( 'invitation_accepted' => true ) );
197
		}
198
		/**
199
		 * Fires when a new user is registered on a site
200
		 *
201
		 * @since 4.9.0
202
		 *
203
		 * @param object The WP_User object
204
		 */
205
		do_action( 'jetpack_sync_register_user', $user_id, $this->get_flags( $user_id ) );
206
207
	}
208
209
	function add_user_to_blog_handler( $user_id, $old_user_data = null ) {
210
		// ensure we only sync users who are members of the current blog
@@ 209-226 (lines=18) @@
206
207
	}
208
209
	function add_user_to_blog_handler( $user_id, $old_user_data = null ) {
210
		// ensure we only sync users who are members of the current blog
211
		if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) {
212
			return;
213
		}
214
215
		if ( Jetpack_Constants::is_true( 'JETPACK_INVITE_ACCEPTED' ) ) {
216
			$this->add_flags( $user_id, array( 'invitation_accepted' => true ) );
217
		}
218
		/**
219
		 * Fires when a user is added on a site
220
		 *
221
		 * @since 4.9.0
222
		 *
223
		 * @param object The WP_User object
224
		 */
225
		do_action( 'jetpack_sync_add_user', $user_id, $this->get_flags( $user_id ) );
226
	}
227
228
	function save_user_handler( $user_id, $old_user_data = null ) {
229
		// ensure we only sync users who are members of the current blog