Code Duplication    Length = 7-7 lines in 2 locations

lib/export.php 2 locations

@@ 46-52 (lines=7) @@
43
44
        $error = '';
45
46
        foreach ( $posts as $post ) {
47
            $result = $this->update( $post->id() );
48
            if ( is_wp_error( $result ) ) {
49
                /* @var WP_Error $result */
50
                $error = wogh_append_error( $error, $result );
51
            }
52
        }
53
54
        if ( is_wp_error( $error ) ) {
55
            /* @var WP_Error $error */
@@ 123-129 (lines=7) @@
120
        $persist = $this->app->api()->persist();
121
122
		$error = '';
123
		foreach ( $posts as $post ) {
124
			$result = $this->new_post( $post, $persist );
125
			if ( is_wp_error( $result ) ) {
126
                /* @var WP_Error $result */
127
                $error = wogh_append_error( $error, $result );
128
			}
129
		}
130
131
		if ( is_wp_error( $error ) ) {
132
			return $error;