@@ -78,9 +78,9 @@ public function set_relations( $relations ): void {
78
78
/**
79
79
* Handles an import request happening during a post save or a template redirect.
80
80
*
81
- * @param array $data
81
+ * @param string[] $data
82
82
*
83
- * @return array The updated, if needed, data array.
83
+ * @return string[] The updated, if needed, data array.
84
84
*/
85
85
public function handle_import ( array $ data = array () ) {
86
86
if ( ! $ this ->pre_flight_check () || false === $ sources = $ this ->parse_sources () ) {
@@ -138,7 +138,7 @@ public function handle_import( array $data = array() ) {
138
138
*
139
139
* @return bool
140
140
*/
141
- protected function pre_flight_check ( array $ data = array () ) {
141
+ protected function pre_flight_check () {
142
142
if ( ! $ this ->handle ) {
143
143
return false ;
144
144
}
@@ -157,7 +157,7 @@ protected function pre_flight_check( array $data = array() ) {
157
157
/**
158
158
* Parses the source blog and post IDs from the $_POST array validating them.
159
159
*
160
- * @return array |bool
160
+ * @return int[] |bool
161
161
*/
162
162
public function parse_sources () {
163
163
if ( ! MslsRequest::has_var ( 'msls_import ' ) ) {
@@ -203,6 +203,12 @@ protected function get_the_blog_post_ID( $blog_id ) {
203
203
return $ this ->insert_blog_post ( $ blog_id , $ data );
204
204
}
205
205
206
+ /**
207
+ * @param int $blog_id
208
+ * @param array<string, mixed> $data
209
+ *
210
+ * @return bool|int
211
+ */
206
212
protected function insert_blog_post ( $ blog_id , array $ data = array () ) {
207
213
if ( empty ( $ data ) ) {
208
214
return false ;
@@ -225,6 +231,11 @@ protected function insert_blog_post( $blog_id, array $data = array() ) {
225
231
return $ this ->has_created_post ;
226
232
}
227
233
234
+ /**
235
+ * @param bool $handle
236
+ *
237
+ * @return void
238
+ */
228
239
public function handle ( $ handle ) {
229
240
$ this ->handle = $ handle ;
230
241
@@ -240,11 +251,11 @@ public function handle( $handle ) {
240
251
* Imports content according to the provided coordinates.
241
252
*
242
253
* @param ImportCoordinates $import_coordinates
243
- * @param array $post_fields An optional array of post fields; this can be
244
- * left empty if the method is not called as a consequence
245
- * of filtering the `wp_insert_post_data` filter.
254
+ * @param string[] $post_fields An optional array of post fields; this can be
255
+ * left empty if the method is not called as a consequence
256
+ * of filtering the `wp_insert_post_data` filter.
246
257
*
247
- * @return array An array of modified post fields.
258
+ * @return string[] An array of modified post fields.
248
259
*/
249
260
public function import_content ( ImportCoordinates $ import_coordinates , array $ post_fields = array () ) {
250
261
if ( ! $ import_coordinates ->validate () ) {
@@ -332,10 +343,10 @@ public function import_content( ImportCoordinates $import_coordinates, array $po
332
343
}
333
344
334
345
/**
335
- * @param int $blog_id
336
- * @param int $post_id
337
- * @param array $data
338
- * @return array
346
+ * @param int $blog_id
347
+ * @param int $post_id
348
+ * @param array<string, mixed> $data
349
+ * @return array<string, mixed>
339
350
*/
340
351
protected function update_inserted_blog_post_data ( $ blog_id , $ post_id , array $ data ) {
341
352
$ data ['ID ' ] = $ post_id ;
0 commit comments