Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 34-39 (lines=6) @@
31
		// even though it's messy, we implement these hooks because
32
		// the edit_comment hook doesn't include the data
33
		// so this saves us a DB read for every comment event
34
		foreach ( array( '', 'trackback', 'pingback' ) as $comment_type ) {
35
			foreach ( array( 'unapproved', 'approved' ) as $comment_status ) {
36
				$comment_action_name = "comment_{$comment_status}_{$comment_type}";
37
				add_action( $comment_action_name, $callable, 10, 2 );
38
			}
39
		}
40
41
		// listen for meta changes
42
		$this->init_listeners_for_meta_type( 'comment', $callable );
@@ 77-82 (lines=6) @@
74
	public function init_before_send() {
75
		add_filter( 'jetpack_sync_before_send_wp_insert_comment', array( $this, 'expand_wp_insert_comment' ) );
76
77
		foreach ( array( '', 'trackback', 'pingback' ) as $comment_type ) {
78
			foreach ( array( 'unapproved', 'approved' ) as $comment_status ) {
79
				$comment_action_name = "comment_{$comment_status}_{$comment_type}";
80
				add_filter( 'jetpack_sync_before_send_' . $comment_action_name, array(
81
					$this,
82
					'expand_wp_insert_comment',
83
				) );
84
			}
85
		}