Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 37-42 (lines=6) @@
34
		// even though it's messy, we implement these hooks because
35
		// the edit_comment hook doesn't include the data
36
		// so this saves us a DB read for every comment event
37
		foreach ( array( '', 'trackback', 'pingback' ) as $comment_type ) {
38
			foreach ( array( 'unapproved', 'approved' ) as $comment_status ) {
39
				$comment_action_name = "comment_{$comment_status}_{$comment_type}";
40
				add_action( $comment_action_name, $callable, 10, 2 );
41
			}
42
		}
43
44
		// listen for meta changes
45
		$this->init_listeners_for_meta_type( 'comment', $callable );
@@ 85-90 (lines=6) @@
82
	public function init_before_send() {
83
		add_filter( 'jetpack_sync_before_send_wp_insert_comment', array( $this, 'expand_wp_insert_comment' ) );
84
85
		foreach ( array( '', 'trackback', 'pingback' ) as $comment_type ) {
86
			foreach ( array( 'unapproved', 'approved' ) as $comment_status ) {
87
				$comment_action_name = "comment_{$comment_status}_{$comment_type}";
88
				add_filter(
89
					'jetpack_sync_before_send_' . $comment_action_name,
90
					array(
91
						$this,
92
						'expand_wp_insert_comment',
93
					)