@@ -78,9 +78,9 @@ public function set_relations( $relations ): void {
7878 /**
7979 * Handles an import request happening during a post save or a template redirect.
8080 *
81- * @param array $data
81+ * @param string[] $data
8282 *
83- * @return array The updated, if needed, data array.
83+ * @return string[] The updated, if needed, data array.
8484 */
8585 public function handle_import ( array $ data = array () ) {
8686 if ( ! $ this ->pre_flight_check () || false === $ sources = $ this ->parse_sources () ) {
@@ -138,7 +138,7 @@ public function handle_import( array $data = array() ) {
138138 *
139139 * @return bool
140140 */
141- protected function pre_flight_check ( array $ data = array () ) {
141+ protected function pre_flight_check () {
142142 if ( ! $ this ->handle ) {
143143 return false ;
144144 }
@@ -157,7 +157,7 @@ protected function pre_flight_check( array $data = array() ) {
157157 /**
158158 * Parses the source blog and post IDs from the $_POST array validating them.
159159 *
160- * @return array |bool
160+ * @return int[] |bool
161161 */
162162 public function parse_sources () {
163163 if ( ! MslsRequest::has_var ( 'msls_import ' ) ) {
@@ -203,6 +203,12 @@ protected function get_the_blog_post_ID( $blog_id ) {
203203 return $ this ->insert_blog_post ( $ blog_id , $ data );
204204 }
205205
206+ /**
207+ * @param int $blog_id
208+ * @param array<string, mixed> $data
209+ *
210+ * @return bool|int
211+ */
206212 protected function insert_blog_post ( $ blog_id , array $ data = array () ) {
207213 if ( empty ( $ data ) ) {
208214 return false ;
@@ -225,6 +231,11 @@ protected function insert_blog_post( $blog_id, array $data = array() ) {
225231 return $ this ->has_created_post ;
226232 }
227233
234+ /**
235+ * @param bool $handle
236+ *
237+ * @return void
238+ */
228239 public function handle ( $ handle ) {
229240 $ this ->handle = $ handle ;
230241
@@ -240,11 +251,11 @@ public function handle( $handle ) {
240251 * Imports content according to the provided coordinates.
241252 *
242253 * @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.
246257 *
247- * @return array An array of modified post fields.
258+ * @return string[] An array of modified post fields.
248259 */
249260 public function import_content ( ImportCoordinates $ import_coordinates , array $ post_fields = array () ) {
250261 if ( ! $ import_coordinates ->validate () ) {
@@ -332,10 +343,10 @@ public function import_content( ImportCoordinates $import_coordinates, array $po
332343 }
333344
334345 /**
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>
339350 */
340351 protected function update_inserted_blog_post_data ( $ blog_id , $ post_id , array $ data ) {
341352 $ data ['ID ' ] = $ post_id ;
0 commit comments