@@ -29,37 +29,37 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * Updates all of the current posts in the database on master. |
31 | 31 | * |
32 | - * @param bool $force |
|
33 | - * |
|
34 | - * @return string|WP_Error |
|
35 | - */ |
|
32 | + * @param bool $force |
|
33 | + * |
|
34 | + * @return string|WP_Error |
|
35 | + */ |
|
36 | 36 | public function full( $force = false ) { |
37 | 37 | $posts = $this->app->database()->fetch_all_supported( $force ); |
38 | 38 | |
39 | 39 | if ( is_wp_error( $posts ) ) { |
40 | - /* @var WP_Error $posts */ |
|
40 | + /* @var WP_Error $posts */ |
|
41 | 41 | return $posts; |
42 | 42 | } |
43 | 43 | |
44 | - $error = ''; |
|
45 | - |
|
46 | - foreach ( $posts as $post ) { |
|
47 | - $result = $this->update( $post->id() ); |
|
48 | - if ( is_wp_error( $result ) ) { |
|
49 | - if ( ! empty( $error ) ) { |
|
50 | - $error->add( $result->get_error_code(), $result->get_error_message() ); |
|
51 | - } else { |
|
52 | - $error = $result; |
|
53 | - } |
|
54 | - } |
|
55 | - } |
|
56 | - |
|
57 | - if ( is_wp_error( $error ) ) { |
|
58 | - /* @var WP_Error $error */ |
|
59 | - return $error; |
|
60 | - } |
|
61 | - |
|
62 | - return __( 'Export to GitHub completed successfully.', 'writing-on-github' ); |
|
44 | + $error = ''; |
|
45 | + |
|
46 | + foreach ( $posts as $post ) { |
|
47 | + $result = $this->update( $post->id() ); |
|
48 | + if ( is_wp_error( $result ) ) { |
|
49 | + if ( ! empty( $error ) ) { |
|
50 | + $error->add( $result->get_error_code(), $result->get_error_message() ); |
|
51 | + } else { |
|
52 | + $error = $result; |
|
53 | + } |
|
54 | + } |
|
55 | + } |
|
56 | + |
|
57 | + if ( is_wp_error( $error ) ) { |
|
58 | + /* @var WP_Error $error */ |
|
59 | + return $error; |
|
60 | + } |
|
61 | + |
|
62 | + return __( 'Export to GitHub completed successfully.', 'writing-on-github' ); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $post = $this->app->database()->fetch_by_id( $post_id ); |
90 | 90 | |
91 | 91 | if ( is_wp_error( $post ) ) { |
92 | - /* @var WP_Error $post */ |
|
92 | + /* @var WP_Error $post */ |
|
93 | 93 | return $post; |
94 | 94 | } |
95 | 95 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $result = $this->new_posts( array( $post ) ); |
106 | 106 | |
107 | 107 | if ( is_wp_error( $result ) ) { |
108 | - /* @var WP_Error $result */ |
|
108 | + /* @var WP_Error $result */ |
|
109 | 109 | return $result; |
110 | 110 | } |
111 | 111 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | return $error; |
140 | 140 | } |
141 | 141 | |
142 | - return __( 'Export to GitHub completed successfully.', 'writing-on-github' ); |
|
142 | + return __( 'Export to GitHub completed successfully.', 'writing-on-github' ); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | protected function new_post( $post, $persist ) { |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $post = $this->app->database()->fetch_by_id( $post_id ); |
220 | 220 | |
221 | 221 | if ( is_wp_error( $post ) ) { |
222 | - /* @var WP_Error $post */ |
|
222 | + /* @var WP_Error $post */ |
|
223 | 223 | return $post; |
224 | 224 | } |
225 | 225 | |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | $result = $this->app->api()->persist()->delete_file( $github_path, $post->sha(), $message ); |
240 | 240 | |
241 | 241 | if ( is_wp_error( $result ) ) { |
242 | - /* @var WP_Error $result */ |
|
242 | + /* @var WP_Error $result */ |
|
243 | 243 | return $result; |
244 | 244 | } |
245 | 245 |