Skip to content

Commit e0127e6

Browse files
committed
CS fixed
1 parent 05059ff commit e0127e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+341
-187
lines changed

includes/Component/Icon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ abstract class Icon {
1717
* Icon constructor
1818
*/
1919
public function __construct() {
20-
if( $this->get_include() ) {
20+
if ( $this->get_include() ) {
2121
$this->map = include $this->get_include();
2222
}
2323
}

includes/Component/Icon/IconSvg.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected function get_include(): string {
2626
* @return string
2727
*/
2828
public function get( string $language ): string {
29-
return $this->map[ $language ] ?? $this->maybe( $language, 'flag-icon-' );
29+
return $this->map[ $language ] ?? $this->maybe( $language, 'flag-icon-' );
3030
}
3131

3232
}

includes/Component/Input/Checkbox.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@ class Checkbox implements InputInterface {
2525
* @param string $value
2626
*/
2727
public function __construct( string $key, ?string $value ) {
28-
$this->key = esc_attr( $key );
28+
$this->key = esc_attr( $key );
2929
$this->selected = checked( 1, $value, false );
3030
}
3131

3232
/**
3333
* @return string
3434
*/
3535
public function render(): string {
36-
return sprintf( '<input type="checkbox" id="%1$s" name="msls[%1$s]" value="1" %2$s/>', $this->key, $this->selected );
36+
return sprintf( '<input type="checkbox" id="%1$s" name="msls[%1$s]" value="1" %2$s/>',
37+
$this->key,
38+
$this->selected );
3739
}
3840

3941
}

includes/Component/Input/Text.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public function render(): string {
5252
$this->size,
5353
$this->readonly
5454
);
55-
5655
}
5756

5857
}

includes/ContentImport/ContentImporter.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function handle_import( array $data = [] ) {
132132
$data = $this->import_content( $import_coordinates, $data );
133133

134134
if ( $this->has_created_post ) {
135-
$this->update_inserted_blog_post_data($dest_blog_id, $dest_post_id, $data );
135+
$this->update_inserted_blog_post_data( $dest_blog_id, $dest_post_id, $data );
136136
$this->redirect_to_blog_post( $dest_blog_id, $dest_post_id );
137137
}
138138

@@ -238,7 +238,7 @@ public function handle( $handle ) {
238238
/**
239239
* Imports content according to the provided coordinates.
240240
*
241-
* @param ImportCoordinates $import_coordinates
241+
* @param ImportCoordinates $import_coordinates
242242
* @param array $post_fields An optional array of post fields; this can be
243243
* left empty if the method is not called as a consequence
244244
* of filtering the `wp_insert_post_data` filter.
@@ -260,10 +260,11 @@ public function import_content( ImportCoordinates $import_coordinates, array $po
260260
/**
261261
* Filters the data before the import runs.
262262
*
263-
* @since TBD
264-
*
265263
* @param array $post_fields
266264
* @param ImportCoordinates $import_coordinates
265+
*
266+
* @since TBD
267+
*
267268
*/
268269
$post_fields = apply_filters( 'msls_content_import_data_before_import', $post_fields, $import_coordinates );
269270

@@ -305,11 +306,12 @@ public function import_content( ImportCoordinates $import_coordinates, array $po
305306
/**
306307
* Fires after the import ran.
307308
*
308-
* @since TBD
309-
*
310309
* @param ImportCoordinates $import_coordinates
311310
* @param ImportLogger $logger
312311
* @param Relations $relations
312+
*
313+
* @since TBD
314+
*
313315
*/
314316
do_action( 'msls_content_import_after_import', $import_coordinates, $this->logger, $this->relations );
315317

@@ -321,7 +323,11 @@ public function import_content( ImportCoordinates $import_coordinates, array $po
321323
* @param ImportLogger $logger
322324
* @param Relations $relations
323325
*/
324-
return apply_filters( 'msls_content_import_data_after_import', $post_fields, $import_coordinates, $this->logger, $this->relations );
326+
return apply_filters( 'msls_content_import_data_after_import',
327+
$post_fields,
328+
$import_coordinates,
329+
$this->logger,
330+
$this->relations );
325331
}
326332

327333
/**
@@ -330,7 +336,7 @@ public function import_content( ImportCoordinates $import_coordinates, array $po
330336
*
331337
* @return array
332338
*/
333-
protected function update_inserted_blog_post_data($blog_id, $post_id, array $data ) {
339+
protected function update_inserted_blog_post_data( $blog_id, $post_id, array $data ) {
334340
$data['ID'] = $post_id;
335341
$data['post_status'] = empty( $data['post_status'] ) || $data['post_status'] === 'auto-draft'
336342
? 'draft'

includes/ContentImport/ImportLogger.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function save() {
8181
* Logs an error.
8282
*
8383
* @param string $where A location string using `/` as level format.
84-
* @param mixed $what What should be stored in the log.
84+
* @param mixed $what What should be stored in the log.
8585
*/
8686
public function log_error( $where, $what ) {
8787
$this->log( $where, $what, 'error' );
@@ -91,8 +91,8 @@ public function log_error( $where, $what ) {
9191
* Logs something.
9292
*
9393
* @param string $where A location string using `/` as level format.
94-
* @param mixed $what What should be stored in the log.
95-
* @param string $root Where to log the information.
94+
* @param mixed $what What should be stored in the log.
95+
* @param string $root Where to log the information.
9696
*/
9797
protected function log( $where, $what, $root = 'info' ) {
9898
if ( ! isset( $this->data[ $root ] ) ) {
@@ -111,7 +111,8 @@ protected function build_nested_array( $path, $what = '' ) {
111111
. '":' . json_encode( $what )
112112
. implode(
113113
'',
114-
array_fill( 0, count( $path ),
114+
array_fill( 0,
115+
count( $path ),
115116
'}' )
116117
);
117118
$data = json_decode( $json, true );
@@ -152,7 +153,7 @@ public function set_levels_delimiter( $levels_delimiter ) {
152153
* Logs a success.
153154
*
154155
* @param string $where A location string using `/` as level format.
155-
* @param mixed $what What should be stored in the log.
156+
* @param mixed $what What should be stored in the log.
156157
*/
157158
public function log_success( $where, $what ) {
158159
$this->log( $where, $what, 'success' );

includes/ContentImport/Importers/Attachments/Linking.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@ class Linking extends BaseImporter {
2222
*/
2323
public static function info() {
2424
return (object) [
25-
'slug' => static::TYPE,
26-
'name' => __( 'Linking', 'multisite-language-switcher' ),
27-
'description' => __( 'Links the media attachments from the source post to the destination post; media attachments are not duplicated.', 'multisite-language-switcher' )
25+
'slug' => static::TYPE,
26+
'name' => __( 'Linking', 'multisite-language-switcher' ),
27+
'description' => __( 'Links the media attachments from the source post to the destination post; media attachments are not duplicated.',
28+
'multisite-language-switcher' )
2829
];
2930
}
3031

3132
public function import( array $data ) {
3233
$this->logger->log_information(
3334
'post-attachments',
34-
__( 'Post attachments were left in place in the source blog and linked in the destination post.', 'multisite-language-switcher' )
35+
__( 'Post attachments were left in place in the source blog and linked in the destination post.',
36+
'multisite-language-switcher' )
3537
);
3638

3739
return parent::import( $data );

includes/ContentImport/Importers/BaseImporter.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,16 @@ class BaseImporter implements Importer {
2727
* BaseImporter constructor.
2828
*
2929
* @param ImportLogger|null $logger
30-
* @param Relations|null $relations
30+
* @param Relations|null $relations
3131
*/
32-
public function __construct( ImportCoordinates $import_coordinates, ImportLogger $logger = null, Relations $relations = null ) {
32+
public function __construct(
33+
ImportCoordinates $import_coordinates,
34+
ImportLogger $logger = null,
35+
Relations $relations = null
36+
) {
3337
$this->import_coordinates = $import_coordinates;
34-
$this->logger = $logger ?: new ImportLogger( $this->import_coordinates );
35-
$this->relations = $relations ?: new Relations( $this->import_coordinates );
38+
$this->logger = $logger ?: new ImportLogger( $this->import_coordinates );
39+
$this->relations = $relations ?: new Relations( $this->import_coordinates );
3640
}
3741

3842
/**

includes/ContentImport/Importers/Importer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace lloc\Msls\ContentImport\Importers;
34

45
use lloc\Msls\ContentImport\ImportCoordinates;
@@ -36,5 +37,5 @@ public function get_relations();
3637
*
3738
* @return \stdClass
3839
*/
39-
public static function info( );
40+
public static function info();
4041
}

includes/ContentImport/Importers/ImportersBaseFactory.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ public function make( ImportCoordinates $import_coordinates ) {
4545
/**
4646
* Filters the importers map.
4747
*
48-
* @since TBD
49-
*
5048
* @param array $map A map of importers in the shape [ <importer-slug> => <importer-class> ]
5149
* @param ImportCoordinates $import_coordinates
50+
*
51+
* @since TBD
52+
*
5253
*/
5354
$map = apply_filters( "msls_content_import_{$type}_importers_map", $this->importers_map, $import_coordinates );
5455

@@ -87,10 +88,11 @@ public function selected() {
8788
/**
8889
* Filters the selected importer that among the available ones.
8990
*
90-
* @since TBD
91-
*
9291
* @param string $selected The selected importer slug.
9392
* @param ImportersFactory $this
93+
*
94+
* @since TBD
95+
*
9496
*/
9597
$selected = apply_filters( "msls_content_import_{$slug}_selected", $selected, $this );
9698

0 commit comments

Comments
 (0)