diff --git a/includes/ContentImport/ImportLogger.php b/includes/ContentImport/ImportLogger.php index 64817834..045c2234 100644 --- a/includes/ContentImport/ImportLogger.php +++ b/includes/ContentImport/ImportLogger.php @@ -7,9 +7,12 @@ class ImportLogger { - protected $levels_delimiter = '/'; + protected string $levels_delimiter = '/'; - protected $data = array( + /** + * @var array + */ + protected array $data = array( 'info' => array(), 'error' => array(), 'success' => array(), @@ -29,7 +32,7 @@ public function __construct( ImportCoordinates $import_coordinates ) { * * @param ImportLogger|null $logger */ - public function merge( ImportLogger $logger = null ) { + public function merge( ImportLogger $logger = null ): void { if ( null === $logger ) { return; } @@ -38,16 +41,16 @@ public function merge( ImportLogger $logger = null ) { } /** - * @return array + * @return array */ - public function get_data() { + public function get_data(): array { return $this->data; } /** * Saves the log or prints it some place. */ - public function save() { + public function save(): void { $log_writer = $default_log_writer = AdminNoticeLogger::instance(); $log_writer->set_import_coordinates( $this->import_coordinates ); @@ -82,7 +85,7 @@ public function save() { * @param string $where A location string using `/` as level format. * @param mixed $what What should be stored in the log. */ - public function log_error( $where, $what ) { + public function log_error( $where, $what ): void { $this->log( $where, $what, 'error' ); } @@ -93,7 +96,7 @@ public function log_error( $where, $what ) { * @param mixed $what What should be stored in the log. * @param string $root Where to log the information. */ - protected function log( $where, $what, $root = 'info' ) { + protected function log( $where, $what, $root = 'info' ): void { if ( ! isset( $this->data[ $root ] ) ) { $this->data[ $root ] = array(); } @@ -103,7 +106,7 @@ protected function log( $where, $what, $root = 'info' ) { $this->data[ $root ] = array_merge_recursive( $this->data[ $root ], $data ); } - protected function build_nested_array( $path, $what = '' ) { + protected function build_nested_array( $path, $what = '' ): array { $json = '{"' . implode( '":{"', $path ) . '":' . wp_json_encode( $what ) @@ -125,7 +128,7 @@ protected function build_nested_array( $path, $what = '' ) { * * @return array */ - protected function build_path( $where ) { + protected function build_path( $where ): array { $where_path = explode( $this->levels_delimiter, $where ); return $where_path; @@ -136,7 +139,7 @@ protected function build_path( $where ) { * * @return string */ - public function get_levels_delimiter() { + public function get_levels_delimiter(): string { return $this->levels_delimiter; } @@ -145,7 +148,7 @@ public function get_levels_delimiter() { * * @param string $levels_delimiter */ - public function set_levels_delimiter( $levels_delimiter ) { + public function set_levels_delimiter( $levels_delimiter ): void { $this->levels_delimiter = $levels_delimiter; } @@ -155,7 +158,7 @@ public function set_levels_delimiter( $levels_delimiter ) { * @param string $where A location string using `/` as level format. * @param mixed $what What should be stored in the log. */ - public function log_success( $where, $what ) { + public function log_success( $where, $what ): void { $this->log( $where, $what, 'success' ); } @@ -164,16 +167,21 @@ public function log_success( $where, $what ) { * * @param string $message */ - public function log_information( $key, $message ) { + public function log_information( $key, $message ): void { $this->data['info'][ $key ] = $message; } + /** + * @param string $where + * + * @return mixed + */ public function get_error( $where ) { return $this->get_nested_value( 'error' . $this->levels_delimiter . $where ); } /** - * @param $where + * @param string $where * * @return mixed */ @@ -189,10 +197,20 @@ protected function get_nested_value( $where ) { return $data; } + /** + * @param string $where + * + * @return mixed + */ public function get_success( $where ) { return $this->get_nested_value( 'success' . $this->levels_delimiter . $where ); } + /** + * @param string $key + * + * @return mixed + */ public function get_information( $key ) { return isset( $this->data['info'][ $key ] ) ? $this->data['info'][ $key ] : ''; } diff --git a/includes/ContentImport/Importers/AttachmentsImporters.php b/includes/ContentImport/Importers/AttachmentsImporters.php index fc5d1816..f1f33399 100644 --- a/includes/ContentImport/Importers/AttachmentsImporters.php +++ b/includes/ContentImport/Importers/AttachmentsImporters.php @@ -8,21 +8,24 @@ class AttachmentsImporters extends ImportersBaseFactory { const TYPE = 'attachments'; - protected $importers_map = [ + /** + * @var array + */ + protected array $importers_map = array( Linking::TYPE => Linking::class, - ]; + ); /** * Returns the factory details. * - * @return string + * @return \stdClass */ public function details() { - return (object) [ + return (object) array( 'slug' => static::TYPE, 'name' => __( 'Image Attachments', 'multisite-language-switcher' ), 'importers' => $this->importers_info(), 'selected' => $this->selected(), - ]; + ); } } diff --git a/includes/ContentImport/Importers/ImportersBaseFactory.php b/includes/ContentImport/Importers/ImportersBaseFactory.php index 70efb1f0..e2b4ff19 100644 --- a/includes/ContentImport/Importers/ImportersBaseFactory.php +++ b/includes/ContentImport/Importers/ImportersBaseFactory.php @@ -13,10 +13,10 @@ abstract class ImportersBaseFactory extends MslsRegistryInstance implements Impo const TYPE = 'none'; /** - * @var array An array defining the slug and Importer class relationships in + * @var array An array defining the slug and Importer class relationships in * the shape [ => ] */ - protected $importers_map = []; + protected array $importers_map = array(); /** * @return Importer @@ -49,7 +49,6 @@ public function make( ImportCoordinates $import_coordinates ) { * @param ImportCoordinates $import_coordinates * * @since TBD - * */ $map = apply_filters( "msls_content_import_{$type}_importers_map", $this->importers_map, $import_coordinates ); @@ -70,10 +69,10 @@ public function make( ImportCoordinates $import_coordinates ) { * @return \stdClass */ public function details() { - return (object) [ + return (object) array( 'name' => 'Base Factory', - 'importers' => [], - ]; + 'importers' => array(), + ); } /** @@ -90,9 +89,6 @@ public function selected() { * * @param string $selected The selected importer slug. * @param ImportersFactory $this - * - * @since TBD - * */ $selected = apply_filters( "msls_content_import_{$slug}_selected", $selected, $this ); @@ -102,9 +98,12 @@ public function selected() { protected function importers_info() { return array_combine( array_keys( $this->importers_map ), - array_map( function ( $importer_class ) { - return $importer_class::info(); - }, $this->importers_map ) + array_map( + function ( $importer_class ) { + return $importer_class::info(); + }, + $this->importers_map + ) ); } -} \ No newline at end of file +} diff --git a/includes/ContentImport/Importers/ImportersFactory.php b/includes/ContentImport/Importers/ImportersFactory.php index 086f6a04..3735b4f7 100644 --- a/includes/ContentImport/Importers/ImportersFactory.php +++ b/includes/ContentImport/Importers/ImportersFactory.php @@ -18,7 +18,7 @@ public function make( ImportCoordinates $import_coordinates ); /** * Returns the factory details. * - * @return string + * @return \stdClass */ public function details(); @@ -28,4 +28,4 @@ public function details(); * @return string */ public function selected(); -} \ No newline at end of file +} diff --git a/includes/ContentImport/Importers/PostFieldsImporters.php b/includes/ContentImport/Importers/PostFieldsImporters.php index 1f1aa41e..2e0d989e 100644 --- a/includes/ContentImport/Importers/PostFieldsImporters.php +++ b/includes/ContentImport/Importers/PostFieldsImporters.php @@ -8,21 +8,24 @@ class PostFieldsImporters extends ImportersBaseFactory { const TYPE = 'post-fields'; - protected $importers_map = [ + /** + * @var array + */ + protected array $importers_map = array( Duplicating::TYPE => Duplicating::class, - ]; + ); /** * Returns the factory details. * - * @return string + * @return \stdClass */ public function details() { - return (object) [ + return (object) array( 'slug' => static::TYPE, 'name' => __( 'Post Fields', 'multisite-language-switcher' ), 'importers' => $this->importers_info(), 'selected' => $this->selected(), - ]; + ); } } diff --git a/includes/ContentImport/Importers/PostMeta/Duplicating.php b/includes/ContentImport/Importers/PostMeta/Duplicating.php index 356248e6..fbdc7c37 100644 --- a/includes/ContentImport/Importers/PostMeta/Duplicating.php +++ b/includes/ContentImport/Importers/PostMeta/Duplicating.php @@ -2,6 +2,7 @@ namespace lloc\Msls\ContentImport\Importers\PostMeta; +use lloc\Msls\ContentImport\ImportCoordinates; use lloc\Msls\ContentImport\Importers\BaseImporter; class Duplicating extends BaseImporter { @@ -14,11 +15,11 @@ class Duplicating extends BaseImporter { * @return \stdClass */ public static function info() { - return (object) [ - 'slug' => static::TYPE, - 'name' => __( 'Duplicating', 'multisite-language-switcher' ), - 'description' => __( 'Copies the source post meta to the destination.', 'multisite-language-switcher' ) - ]; + return (object) array( + 'slug' => static::TYPE, + 'name' => __( 'Duplicating', 'multisite-language-switcher' ), + 'description' => __( 'Copies the source post meta to the destination.', 'multisite-language-switcher' ), + ); } public function import( array $data ) { @@ -49,6 +50,13 @@ public function import( array $data ) { return $data; } + /** + * Filters the post meta that should not be imported. + * + * @param array $meta + * + * @return array + */ public function filter_post_meta( array $meta ) { $blacklist = array( '_edit_last', '_thumbnail_id', '_edit_lock' ); @@ -59,11 +67,13 @@ public function filter_post_meta( array $meta ) { * @param array $meta * @param ImportCoordinates $import_coordinates */ - $blacklist = apply_filters( 'msls_content_import_post_meta_blacklist', + $blacklist = apply_filters( + 'msls_content_import_post_meta_blacklist', $blacklist, $meta, - $this->import_coordinates ); + $this->import_coordinates + ); return array_diff_key( $meta, array_combine( $blacklist, $blacklist ) ); } -} \ No newline at end of file +} diff --git a/includes/ContentImport/Importers/PostMetaImporters.php b/includes/ContentImport/Importers/PostMetaImporters.php index da6d2315..8930ff9d 100644 --- a/includes/ContentImport/Importers/PostMetaImporters.php +++ b/includes/ContentImport/Importers/PostMetaImporters.php @@ -8,21 +8,24 @@ class PostMetaImporters extends ImportersBaseFactory { const TYPE = 'post-meta'; - protected $importers_map = [ + /** + * @var array + */ + protected array $importers_map = array( Duplicating::TYPE => Duplicating::class, - ]; + ); /** * Returns the factory details. * - * @return string + * @return \stdClass */ public function details() { - return (object) [ + return (object) array( 'slug' => static::TYPE, 'name' => __( 'Meta Fields', 'multisite-language-switcher' ), 'importers' => $this->importers_info(), 'selected' => $this->selected(), - ]; + ); } } diff --git a/includes/ContentImport/Importers/PostThumbnail/Linking.php b/includes/ContentImport/Importers/PostThumbnail/Linking.php index ec9c4820..32cbdcdd 100644 --- a/includes/ContentImport/Importers/PostThumbnail/Linking.php +++ b/includes/ContentImport/Importers/PostThumbnail/Linking.php @@ -22,12 +22,14 @@ class Linking extends BaseImporter { * @return \stdClass */ public static function info() { - return (object) [ + return (object) array( 'slug' => static::TYPE, 'name' => __( 'Linking', 'multisite-language-switcher' ), - 'description' => __( 'Links the featured image from the source post to the destination post; the image is not duplicated.', - 'multisite-language-switcher' ) - ]; + 'description' => __( + 'Links the featured image from the source post to the destination post; the image is not duplicated.', + 'multisite-language-switcher' + ), + ); } public function import( array $data ) { @@ -55,12 +57,19 @@ public function import( array $data ) { if ( $source_post_thumbnail_attachment instanceof \WP_Post ) { // in some instances the folder sep. `/` might be duplicated, we de-duplicate it - array_walk( $source_upload_dir, function ( &$entry ) { - $entry = str_replace( '//', '/', $entry ); - } ); - $source_uploads_dir = untrailingslashit( str_replace( $source_upload_dir['subdir'], - '', - $source_upload_dir['path'] ) ); + array_walk( + $source_upload_dir, + function ( &$entry ) { + $entry = str_replace( '//', '/', $entry ); + } + ); + $source_uploads_dir = untrailingslashit( + str_replace( + $source_upload_dir['subdir'], + '', + $source_upload_dir['path'] + ) + ); $source_post_thumbnail_file = $source_uploads_dir . '/' . $source_post_thumbnail_meta['_wp_attached_file']; // Check the type of file. We'll use this as the 'post_mime_type'. @@ -75,10 +84,10 @@ public function import( array $data ) { 'post_status' => 'inherit', ); - $existing_criteria = [ + $existing_criteria = array( 'post_type' => 'attachment', 'title' => $attachment['post_title'], - ]; + ); $found = get_posts( $existing_criteria ); @@ -87,9 +96,11 @@ public function import( array $data ) { $this->logger->log_success( 'post-thumbnail/existing', $dest_post_thumbnail_id ); } else { // Insert the attachment. - $dest_post_thumbnail_id = wp_insert_attachment( $attachment, + $dest_post_thumbnail_id = wp_insert_attachment( + $attachment, $source_post_thumbnail_file, - $dest_post_id ); + $dest_post_id + ); if ( empty( $dest_post_thumbnail_id ) ) { $this->logger->log_error( 'post-thumbnail/created', $dest_post_thumbnail_id ); @@ -105,10 +116,14 @@ public function import( array $data ) { } } - update_post_meta( $dest_post_thumbnail_id, AttachmentPathFinder::LINKED, [ - 'blog' => $source_blog_id, - 'post' => $source_post_thumbnail_id - ] ); + update_post_meta( + $dest_post_thumbnail_id, + AttachmentPathFinder::LINKED, + array( + 'blog' => $source_blog_id, + 'post' => $source_post_thumbnail_id, + ) + ); $dest_post_thumbnail_set = set_post_thumbnail( $dest_post_id, $dest_post_thumbnail_id ); @@ -124,11 +139,22 @@ public function import( array $data ) { return $data; } + /** + * @param int $source_post_thumbnail_id + * + * @return array + */ protected function get_attachment_meta( $source_post_thumbnail_id ) { - $keys = [ '_wp_attached_file', '_wp_attachment_metadata', '_wp_attachment_image_alt' ]; - - return array_combine( $keys, array_map( function ( $key ) use ( $source_post_thumbnail_id ) { - return get_post_meta( $source_post_thumbnail_id, $key, true ); - }, $keys ) ); + $keys = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_attachment_image_alt' ); + + return array_combine( + $keys, + array_map( + function ( $key ) use ( $source_post_thumbnail_id ) { + return get_post_meta( $source_post_thumbnail_id, $key, true ); + }, + $keys + ) + ); } -} \ No newline at end of file +} diff --git a/includes/ContentImport/Importers/PostThumbnailImporters.php b/includes/ContentImport/Importers/PostThumbnailImporters.php index 8668defe..d1cb0716 100644 --- a/includes/ContentImport/Importers/PostThumbnailImporters.php +++ b/includes/ContentImport/Importers/PostThumbnailImporters.php @@ -8,21 +8,24 @@ class PostThumbnailImporters extends ImportersBaseFactory { const TYPE = 'post-thumbnail'; - protected $importers_map = [ + /** + * @var array + */ + protected array $importers_map = array( Linking::TYPE => Linking::class, - ]; + ); /** * Returns the factory details. * - * @return string + * @return \stdClass */ public function details() { - return (object) [ + return (object) array( 'slug' => static::TYPE, 'name' => __( 'Featured Image', 'multisite-language-switcher' ), 'importers' => $this->importers_info(), 'selected' => $this->selected(), - ]; + ); } } diff --git a/includes/ContentImport/Importers/Terms/ShallowDuplicating.php b/includes/ContentImport/Importers/Terms/ShallowDuplicating.php index e35520c0..2b70d0c6 100644 --- a/includes/ContentImport/Importers/Terms/ShallowDuplicating.php +++ b/includes/ContentImport/Importers/Terms/ShallowDuplicating.php @@ -2,6 +2,7 @@ namespace lloc\Msls\ContentImport\Importers\Terms; +use lloc\Msls\ContentImport\ImportCoordinates; use lloc\Msls\ContentImport\Importers\BaseImporter; use lloc\Msls\MslsOptionsTax; use lloc\Msls\MslsOptionsTaxTerm; @@ -95,6 +96,13 @@ public function import( array $data ) { return $data; } + /** + * @param \WP_Term $term + * @param MslsOptionsTaxTerm $msls_term + * @param string $dest_lang + * + * @return bool|int + */ protected function create_local_term( \WP_Term $term, MslsOptionsTax $msls_term, $dest_lang ) { $meta = get_term_meta( $term->term_id ); $dest_term_id = wp_create_term( $term->name, $term->taxonomy ); @@ -118,6 +126,12 @@ protected function create_local_term( \WP_Term $term, MslsOptionsTax $msls_term, return $dest_term_id; } + /** + * @param array $meta + * @param \WP_Term $term + * + * @return array + */ protected function filter_term_meta( array $meta, \WP_Term $term ) { /** * Filters the list of term meta that should not be imported for a term. @@ -138,6 +152,13 @@ protected function filter_term_meta( array $meta, \WP_Term $term ) { return array_diff_key( $meta, array_combine( $blacklist, $blacklist ) ); } + /** + * @param int $object_id + * @param int $dest_term_id + * @param string $taxonomy + * + * @return array|\WP_Error + */ protected function update_object_terms( $object_id, $dest_term_id, $taxonomy ) { if ( ! in_array( $taxonomy, $this->reset_taxonomies, true ) ) { wp_set_object_terms( $object_id, array(), $taxonomy ); diff --git a/includes/ContentImport/Importers/TermsImporters.php b/includes/ContentImport/Importers/TermsImporters.php index 9ed1a68c..21b7d86d 100644 --- a/includes/ContentImport/Importers/TermsImporters.php +++ b/includes/ContentImport/Importers/TermsImporters.php @@ -8,21 +8,24 @@ class TermsImporters extends ImportersBaseFactory { const TYPE = 'terms'; - protected $importers_map = [ + /** + * @var array + */ + protected array $importers_map = array( ShallowDuplicating::TYPE => ShallowDuplicating::class, - ]; + ); /** * Returns the factory details. * - * @return string + * @return \stdClass */ public function details() { - return (object) [ + return (object) array( 'slug' => static::TYPE, 'name' => __( 'Taxonomy Terms', 'multisite-language-switcher' ), 'importers' => $this->importers_info(), 'selected' => $this->selected(), - ]; + ); } } diff --git a/includes/ContentImport/LogWriters/AdminNoticeLogger.php b/includes/ContentImport/LogWriters/AdminNoticeLogger.php index dd11d0fa..15966ee8 100644 --- a/includes/ContentImport/LogWriters/AdminNoticeLogger.php +++ b/includes/ContentImport/LogWriters/AdminNoticeLogger.php @@ -6,7 +6,8 @@ use lloc\Msls\MslsRegistryInstance; class AdminNoticeLogger extends MslsRegistryInstance implements LogWriter { - protected $transient = 'msls_last_import_log'; + + protected string $transient = 'msls_last_import_log'; /** * @var ImportCoordinates @@ -105,7 +106,14 @@ public function write( array $data ) { set_transient( $this->transient, $html, HOUR_IN_SECONDS ); } - protected function get_section_html( $section_title, $entries, $escape_entries = true ) { + /** + * @param string $section_title + * @param array $entries + * @param bool $escape_entries + * + * @return string + */ + protected function get_section_html( $section_title, $entries, $escape_entries = true ): string { $html = '

' . $section_title . '

'; $html .= '
    '; foreach ( $entries as $entry ) { @@ -120,9 +128,16 @@ protected function get_section_html( $section_title, $entries, $escape_entries = return $html; } - public function show_last_log( $echo = true ) { + /** + * Shows the last log that was written. + * + * @param bool $echo + * + * @return ?string + */ + public function show_last_log( $echo = true ): ?string { if ( ! ( $html = get_transient( $this->transient ) ) ) { - return; + return null; } if ( $echo ) { @@ -135,7 +150,10 @@ public function show_last_log( $echo = true ) { return $html; } - public function set_import_coordinates( $import_coordinates ) { + /** + * @param ImportCoordinates $import_coordinates + */ + public function set_import_coordinates( $import_coordinates ): void { $this->import_coordinates = $import_coordinates; } @@ -144,7 +162,7 @@ public function set_import_coordinates( $import_coordinates ) { * * @return string */ - public function get_transient() { + public function get_transient(): string { return $this->transient; } } diff --git a/includes/ContentImport/MetaBox.php b/includes/ContentImport/MetaBox.php index f37e7361..01791a19 100644 --- a/includes/ContentImport/MetaBox.php +++ b/includes/ContentImport/MetaBox.php @@ -18,7 +18,7 @@ class MetaBox extends MslsRegistryInstance { /** * Renders the content import metabox. */ - public function render() { + public function render(): void { $post = get_post(); $mydata = new MslsOptionsPost( $post->ID ); $languages = MslsOptionsPost::instance()->get_available_languages(); @@ -83,7 +83,7 @@ function ( $lang ) use ( $mydata ) { echo $output; } - protected function inline_thickbox_url( array $data = array() ) { + protected function inline_thickbox_url( array $data = array() ): string { $args = array_merge( array( 'modal' => true, @@ -99,11 +99,11 @@ protected function inline_thickbox_url( array $data = array() ) { ); } - public function print_modal_html() { + public function print_modal_html(): void { echo $this->inline_thickbox_html( true, $this->data ); } - protected function inline_thickbox_html( $echo = true, array $data = array() ) { + protected function inline_thickbox_html( $echo = true, array $data = array() ): string { if ( ! isset( $data['msls_import'] ) ) { return ''; } diff --git a/includes/ContentImport/Relations.php b/includes/ContentImport/Relations.php index 06abeebe..c7bcea1e 100644 --- a/includes/ContentImport/Relations.php +++ b/includes/ContentImport/Relations.php @@ -13,15 +13,9 @@ */ class Relations { - /** - * @var MslsOptions[] - */ - public $to_create = []; + public array $to_create = array(); - /** - * @var MslsOptions[] - */ - protected $local_options = []; + protected array $local_options = array(); /** * @var ImportCoordinates @@ -42,7 +36,7 @@ public function __construct( ImportCoordinates $import_coordinates ) { * * @param Relations|null $relations */ - public function merge( Relations $relations = null ) { + public function merge( Relations $relations = null ): void { if ( null === $relations ) { return; } @@ -53,36 +47,35 @@ public function merge( Relations $relations = null ) { /** * @return array */ - public function get_data() { + public function get_data(): array { return $this->to_create; } /** * Creates the relations between the source blog elements and the destination one. */ - public function create() { + public function create(): void { $this->create_source_to_local(); $this->create_local_to_source(); restore_current_blog(); } - protected function create_source_to_local() { + protected function create_source_to_local(): void { switch_to_blog( $this->import_coordinates->source_blog_id ); foreach ( $this->to_create as $relation ) { /** @var MslsOptions $option */ list( $option, $lang, $id ) = $relation; - $option->save( [ $lang => $id ] ); + $option->save( array( $lang => $id ) ); $source_id = $option->get_arg( 0, $id ); - $this->local_options[ $source_id ] = [ $option, $id ]; + $this->local_options[ $source_id ] = array( $option, $id ); } } - protected function create_local_to_source() { + protected function create_local_to_source(): void { switch_to_blog( $this->import_coordinates->dest_blog_id ); - /** @var MslsOptions $local_option */ foreach ( $this->local_options as $source_id => $option_data ) { list( $source_option, $local_id ) = $option_data; @@ -94,18 +87,20 @@ protected function create_local_to_source() { * @param int $source_id * @param MslsOptions $source_option */ - $created = apply_filters( 'msls_content_import_relation_local_to_source_create', + $created = apply_filters( + 'msls_content_import_relation_local_to_source_create', null, $local_id, $source_id, - $source_option ); + $source_option + ); if ( null !== $created ) { continue; } $option_class = get_class( $source_option ); - $local_option = call_user_func( [ $option_class, 'create' ], $local_id ); - $local_option->save( [ $this->import_coordinates->source_lang => $source_id ] ); + $local_option = call_user_func( array( $option_class, 'create' ), $local_id ); + $local_option->save( array( $this->import_coordinates->source_lang => $source_id ) ); } } @@ -113,10 +108,10 @@ protected function create_local_to_source() { * Sets a relation that should be created. * * @param MslsOptions $creator - * @param string $dest_lang - * @param string $dest_post_id + * @param string $dest_lang + * @param string $dest_post_id */ - public function should_create( MslsOptions $creator, $dest_lang, $dest_post_id ) { - $this->to_create[] = [ $creator, $dest_lang, $dest_post_id ]; + public function should_create( MslsOptions $creator, $dest_lang, $dest_post_id ): void { + $this->to_create[] = array( $creator, $dest_lang, $dest_post_id ); } -} \ No newline at end of file +}