Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 32-37 (lines=6) @@
29
		// even though it's messy, we implement these hooks because
30
		// the edit_comment hook doesn't include the data
31
		// so this saves us a DB read for every comment event
32
		foreach ( array( '', 'trackback', 'pingback' ) as $comment_type ) {
33
			foreach ( array( 'unapproved', 'approved' ) as $comment_status ) {
34
				$comment_action_name = "comment_{$comment_status}_{$comment_type}";
35
				add_action( $comment_action_name, $callable, 10, 2 );
36
			}
37
		}
38
39
		// listen for meta changes
40
		$this->init_listeners_for_meta_type( 'comment', $callable );
@@ 66-71 (lines=6) @@
63
	public function init_before_send() {
64
		add_filter( 'jetpack_sync_before_send_wp_insert_comment', array( $this, 'expand_wp_insert_comment' ) );
65
66
		foreach ( array( '', 'trackback', 'pingback' ) as $comment_type ) {
67
			foreach ( array( 'unapproved', 'approved' ) as $comment_status ) {
68
				$comment_action_name = "comment_{$comment_status}_{$comment_type}";
69
				add_filter( 'jetpack_sync_before_send_' . $comment_action_name, array(
70
					$this,
71
					'expand_wp_insert_comment',
72
				) );
73
			}
74
		}