Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 29-34 (lines=6) @@
26
		// even though it's messy, we implement these hooks because
27
		// the edit_comment hook doesn't include the data
28
		// so this saves us a DB read for every comment event
29
		foreach ( array( '', 'trackback', 'pingback' ) as $comment_type ) {
30
			foreach ( array( 'unapproved', 'approved' ) as $comment_status ) {
31
				$comment_action_name = "comment_{$comment_status}_{$comment_type}";
32
				add_action( $comment_action_name, $callable, 10, 2 );
33
			}
34
		}
35
	}
36
37
	public function init_full_sync_listeners( $callable ) {
@@ 44-49 (lines=6) @@
41
	public function init_before_send() {
42
		add_filter( 'jetpack_sync_before_send_wp_insert_comment', array( $this, 'expand_wp_insert_comment' ) );
43
44
		foreach ( array( '', 'trackback', 'pingback' ) as $comment_type ) {
45
			foreach ( array( 'unapproved', 'approved' ) as $comment_status ) {
46
				$comment_action_name = "comment_{$comment_status}_{$comment_type}";
47
				add_filter( 'jetpack_sync_before_send_' . $comment_action_name, array(
48
					$this,
49
					'expand_wp_insert_comment',
50
				) );
51
			}
52
		}