Skip to content

Commit 5522ece

Browse files
authored
Merge pull request #174 from Yoast/JRF/QA/parameter-renames
CS/QA: rename function parameters
2 parents 4aaa599 + b8c7915 commit 5522ece

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

src/ui/asset-manager.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ public function enqueue_options_styles() {
9999
/**
100100
* Enqueues the script for the Block editor and passes object via localization.
101101
*
102-
* @param array $object The object to pass to the script.
102+
* @param array $data_object The object to pass to the script.
103103
*
104104
* @return void
105105
*/
106-
public function enqueue_edit_script( $object = [] ) {
106+
public function enqueue_edit_script( $data_object = [] ) {
107107
$handle = 'duplicate_post_edit_script';
108108
\wp_enqueue_script( $handle );
109109
\wp_add_inline_script(
@@ -114,24 +114,24 @@ public function enqueue_edit_script( $object = [] ) {
114114
\wp_localize_script(
115115
$handle,
116116
'duplicatePost',
117-
$object
117+
$data_object
118118
);
119119
}
120120

121121
/**
122122
* Enqueues the script for the Javascript strings and passes object via localization.
123123
*
124-
* @param array $object The object to pass to the script.
124+
* @param array $data_object The object to pass to the script.
125125
*
126126
* @return void
127127
*/
128-
public function enqueue_strings_script( $object = [] ) {
128+
public function enqueue_strings_script( $data_object = [] ) {
129129
$handle = 'duplicate_post_strings';
130130
\wp_enqueue_script( $handle );
131131
\wp_localize_script(
132132
$handle,
133133
'duplicatePostStrings',
134-
$object
134+
$data_object
135135
);
136136
}
137137

@@ -156,11 +156,11 @@ public function enqueue_options_script() {
156156
/**
157157
* Enqueues the script for the Elementor plugin.
158158
*
159-
* @param array $object The object to pass to the script.
159+
* @param array $data_object The object to pass to the script.
160160
*
161161
* @return void
162162
*/
163-
public function enqueue_elementor_script( $object = [] ) {
163+
public function enqueue_elementor_script( $data_object = [] ) {
164164
$flattened_version = Utils::flatten_version( \DUPLICATE_POST_CURRENT_VERSION );
165165
$handle = 'duplicate_post_elementor_script';
166166

@@ -175,7 +175,7 @@ public function enqueue_elementor_script( $object = [] ) {
175175
\wp_localize_script(
176176
$handle,
177177
'duplicatePost',
178-
$object
178+
$data_object
179179
);
180180
}
181181
}

src/ui/classic-editor.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,23 +312,23 @@ public function remove_slug_meta_box( $post_type, $post ) {
312312
/**
313313
* Removes the sample permalink slug editor in the Classic Editor when the post is a Rewrite & Republish copy.
314314
*
315-
* @param string $return Sample permalink HTML markup.
315+
* @param string $html Sample permalink HTML markup.
316316
* @param int $post_id Post ID.
317317
* @param string $new_title New sample permalink title.
318318
* @param string $new_slug New sample permalink slug.
319319
* @param WP_Post $post Post object.
320320
*
321321
* @return string The filtered HTML of the sample permalink slug editor.
322322
*/
323-
public function remove_sample_permalink_slug_editor( $return, $post_id, $new_title, $new_slug, $post ) {
323+
public function remove_sample_permalink_slug_editor( $html, $post_id, $new_title, $new_slug, $post ) {
324324
if ( ! $post instanceof WP_Post ) {
325-
return $return;
325+
return $html;
326326
}
327327

328328
if ( $this->permissions_helper->is_rewrite_and_republish_copy( $post ) ) {
329329
return '';
330330
}
331331

332-
return $return;
332+
return $html;
333333
}
334334
}

tests/ui/block-editor-test.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,8 @@ public function test_get_original_post_edit_url_successful() {
720720

721721
Monkey\Functions\expect( '\admin_url' )
722722
->andReturnUsing(
723-
static function ( $string ) {
724-
return 'http://basic.wordpress.test/wp-admin/' . $string;
723+
static function ( $query_string ) {
724+
return 'http://basic.wordpress.test/wp-admin/' . $query_string;
725725
}
726726
);
727727

@@ -731,12 +731,12 @@ static function ( $string ) {
731731

732732
Monkey\Functions\expect( '\add_query_arg' )
733733
->andReturnUsing(
734-
static function ( $array, $string ) {
735-
foreach ( $array as $key => $value ) {
736-
$string .= '&' . $key . '=' . $value;
734+
static function ( $arguments, $query_string ) {
735+
foreach ( $arguments as $key => $value ) {
736+
$query_string .= '&' . $key . '=' . $value;
737737
}
738738

739-
return $string;
739+
return $query_string;
740740
}
741741
);
742742

tests/ui/link-builder-test.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ public function test_build_link() {
129129

130130
Monkey\Functions\expect( '\admin_url' )
131131
->andReturnUsing(
132-
static function ( $string ) {
133-
return 'http://basic.wordpress.test/wp-admin/' . $string;
132+
static function ( $query_string ) {
133+
return 'http://basic.wordpress.test/wp-admin/' . $query_string;
134134
}
135135
);
136136

@@ -160,8 +160,8 @@ public function test_build_link_not_display() {
160160

161161
Monkey\Functions\expect( '\admin_url' )
162162
->andReturnUsing(
163-
static function ( $string ) {
164-
return 'http://basic.wordpress.test/wp-admin/' . $string;
163+
static function ( $query_string ) {
164+
return 'http://basic.wordpress.test/wp-admin/' . $query_string;
165165
}
166166
);
167167

0 commit comments

Comments
 (0)