Skip to content

Commit ab2e6b7

Browse files
authored
Merge pull request #453 from Yoast/JRF/composer-update-yoastcs
Update to YoastCS 3.3.0
2 parents dbdc515 + 52b8451 commit ab2e6b7

Some content is hidden

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

60 files changed

+311
-314
lines changed

admin-functions.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function duplicate_post_plugin_upgrade() {
142142
'new_draft' => '1',
143143
'clone' => '1',
144144
'rewrite_republish' => '1',
145-
]
145+
],
146146
);
147147
add_option( 'duplicate_post_show_link_in', $show_links_in_defaults );
148148

@@ -228,7 +228,7 @@ function duplicate_post_show_update_notice() {
228228
$title = sprintf(
229229
/* translators: %s: Yoast Duplicate Post. */
230230
esc_html__( 'You\'ve successfully installed %s!', 'duplicate-post' ),
231-
'Yoast Duplicate Post'
231+
'Yoast Duplicate Post',
232232
);
233233

234234
$img_path = plugins_url( '/duplicate_post_yoast_icon-125x125.png', __FILE__ );
@@ -453,7 +453,7 @@ function duplicate_post_copy_attachments( $new_id, $post ) {
453453
'numberposts' => -1,
454454
'post_status' => 'any',
455455
'post_parent' => $post->ID,
456-
]
456+
],
457457
);
458458
// Clone old attachments.
459459
foreach ( $children as $child ) {
@@ -518,7 +518,7 @@ function duplicate_post_copy_children( $new_id, $post, $status = '' ) {
518518
'numberposts' => -1,
519519
'post_status' => 'any',
520520
'post_parent' => $post->ID,
521-
]
521+
],
522522
);
523523

524524
foreach ( $children as $child ) {
@@ -543,7 +543,7 @@ function duplicate_post_copy_comments( $new_id, $post ) {
543543
'post_id' => $post->ID,
544544
'order' => 'ASC',
545545
'orderby' => 'comment_date_gmt',
546-
]
546+
],
547547
);
548548

549549
$old_id_to_new = [];
@@ -619,8 +619,8 @@ function duplicate_post_create_duplicate( $post, $status = '', $parent_id = '' )
619619
wp_die(
620620
esc_html(
621621
__( 'Copy features for this post type are not enabled in options page', 'duplicate-post' ) . ': '
622-
. $post->post_type
623-
)
622+
. $post->post_type,
623+
),
624624
);
625625
}
626626

common-functions.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,8 @@ function duplicate_post_clone_post_link( $link = null, $before = '', $after = ''
7777
return;
7878
}
7979

80-
if ( $link === null ) {
81-
$link = __( 'Copy to a new draft', 'duplicate-post' );
82-
}
83-
84-
$link = '<a class="post-clone-link" href="' . esc_url( $url ) . '">' . esc_html( $link ) . '</a>';
80+
$link ??= __( 'Copy to a new draft', 'duplicate-post' );
81+
$link = '<a class="post-clone-link" href="' . esc_url( $url ) . '">' . esc_html( $link ) . '</a>';
8582

8683
/**
8784
* Filter on the clone link HTML.

compat/wpml-functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function duplicate_post_wpml_copy_translations( $post_id, $post, $status = '' )
6464
'post_' . $translation->post_type,
6565
$new_trid,
6666
$code,
67-
$current_language
67+
$current_language,
6868
);
6969
}
7070
}
@@ -112,7 +112,7 @@ function duplicate_wpml_string_packages() { // phpcs:ignore WordPress.NamingConv
112112
$new_string->id,
113113
$language,
114114
$translated_string['value'],
115-
$translated_string['status']
115+
$translated_string['status'],
116116
);
117117
}
118118
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"require-dev": {
3131
"yoast/wp-test-utils": "^1.2.0",
32-
"yoast/yoastcs": "^3.2.0"
32+
"yoast/yoastcs": "^3.3.0"
3333
},
3434
"autoload": {
3535
"classmap": [

config/composer/actions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private static function check_cs_for_changed_files( $compare ) {
120120
$command = \sprintf(
121121
'composer check-cs-warnings -- %s %s',
122122
\implode( ' ', \array_map( 'escapeshellarg', $php_files ) ),
123-
$extra_args
123+
$extra_args,
124124
);
125125
\system( $command, $exit_code );
126126

@@ -196,7 +196,7 @@ private static function filter_files( array $files, string $extension ): array {
196196
$files,
197197
static function ( $file ) use ( $extension ) {
198198
return \substr( $file, ( 0 - \strlen( $extension ) ) ) === $extension;
199-
}
199+
},
200200
);
201201
}
202202
}

duplicate-post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function duplicate_post_plugin_actions( $actions ) {
9393
menu_page_url( 'duplicatepost', false ),
9494
/* translators: Hidden accessibility text. */
9595
'aria-label="' . __( 'Settings for Duplicate Post', 'duplicate-post' ) . '"',
96-
esc_html__( 'Settings', 'duplicate-post' )
96+
esc_html__( 'Settings', 'duplicate-post' ),
9797
),
9898
];
9999

options.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
$duplicate_post_options_page = new Options_Page(
1616
new Options(),
1717
new Options_Form_Generator( new Options_Inputs() ),
18-
new Asset_Manager()
18+
new Asset_Manager(),
1919
);
2020

2121
$duplicate_post_options_page->register_hooks();

src/admin/options-form-generator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function generate_options_input( array $options, $parent_option = '' ) {
7878
$option,
7979
$option_values['value'],
8080
$id,
81-
$this->is_checked( $option, $option_values, $parent_option )
81+
$this->is_checked( $option, $option_values, $parent_option ),
8282
);
8383

8484
$output .= \sprintf( '<label for="%s">%s</label>', $id, \esc_html( $option_values['label'] ) );
@@ -176,7 +176,7 @@ public function generate_taxonomy_exclusion_list() {
176176
'checked' => \in_array( $taxonomy->name, $taxonomies_blacklist, true ),
177177
'label' => $taxonomy->labels->name . ' [' . $taxonomy->name . ']',
178178
],
179-
]
179+
],
180180
);
181181
$output .= '</div>';
182182
}
@@ -212,7 +212,7 @@ public function generate_roles_permission_list() {
212212
'checked' => $role->has_cap( 'copy_posts' ),
213213
'label' => \translate_user_role( $display_name ),
214214
],
215-
]
215+
],
216216
);
217217
}
218218
}
@@ -246,7 +246,7 @@ public function generate_post_types_list() {
246246
'checked' => $this->is_post_type_enabled( $post_type_object->name ),
247247
'label' => $post_type_object->labels->name,
248248
],
249-
]
249+
],
250250
);
251251
}
252252

src/admin/options-inputs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected function input( $type, $name, $value, $id, $attributes = '' ) {
2525
\esc_attr( $name ),
2626
\esc_attr( $id ),
2727
\esc_attr( $value ),
28-
$attributes
28+
$attributes,
2929
);
3030
}
3131

src/admin/options-page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function register_menu() {
7777
\__( 'Duplicate Post', 'duplicate-post' ),
7878
'manage_options',
7979
'duplicatepost',
80-
[ $this, 'generate_page' ]
80+
[ $this, 'generate_page' ],
8181
);
8282

8383
\add_action( $page_hook, [ $this, 'enqueue_assets' ] );

0 commit comments

Comments
 (0)