64643 Remove some obsolete return by refs#10941
Draft
nirav7707 wants to merge 1 commit intoWordPress:trunkfrom
Draft
64643 Remove some obsolete return by refs#10941nirav7707 wants to merge 1 commit intoWordPress:trunkfrom
nirav7707 wants to merge 1 commit intoWordPress:trunkfrom
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Member
|
Take it or leave it, but Gemini CLI found some additional possibilities: diff --git a/src/wp-admin/includes/class-wp-upgrader-skin.php b/src/wp-admin/includes/class-wp-upgrader-skin.php
index 831da3aeba..4c1615cdd2 100644
--- a/src/wp-admin/includes/class-wp-upgrader-skin.php
+++ b/src/wp-admin/includes/class-wp-upgrader-skin.php
@@ -83,9 +83,9 @@ class WP_Upgrader_Skin {
*
* @param WP_Upgrader $upgrader
*/
- public function set_upgrader( &$upgrader ) {
+ public function set_upgrader( $upgrader ) {
if ( is_object( $upgrader ) ) {
- $this->upgrader =& $upgrader;
+ $this->upgrader = $upgrader;
}
$this->add_strings();
}
diff --git a/src/wp-includes/class-wp-hook.php b/src/wp-includes/class-wp-hook.php
index cd6860c0f8..cf6f5aeaca 100644
--- a/src/wp-includes/class-wp-hook.php
+++ b/src/wp-includes/class-wp-hook.php
@@ -375,9 +375,9 @@ final class WP_Hook implements Iterator, ArrayAccess {
*
* @since 4.7.0
*
- * @param array $args Arguments to pass to the hook callbacks. Passed by reference.
+ * @param array $args Arguments to pass to the hook callbacks.
*/
- public function do_all_hook( &$args ) {
+ public function do_all_hook( $args ) {
$nesting_level = $this->nesting_level++;
$this->iterations[ $nesting_level ] = $this->priorities;
diff --git a/src/wp-includes/deprecated.php b/src/wp-includes/deprecated.php
index 390d632492..897b1a48a3 100644
--- a/src/wp-includes/deprecated.php
+++ b/src/wp-includes/deprecated.php
@@ -3111,7 +3111,7 @@ function get_theme_data( $theme_file ) {
*
* @param array $pages list of page objects
*/
-function update_page_cache( &$pages ) {
+function update_page_cache( $pages ) {
_deprecated_function( __FUNCTION__, '3.4.0', 'update_post_cache()' );
update_post_cache( $pages );
@@ -3177,9 +3177,9 @@ function sticky_class( $post_id = null ) {
* @deprecated 3.5.0 Use get_post_ancestors()
* @see get_post_ancestors()
*
- * @param WP_Post $post Post object, passed by reference (unused).
+ * @param WP_Post $post Post object (unused).
*/
-function _get_post_ancestors( &$post ) {
+function _get_post_ancestors( $post ) {
_deprecated_function( __FUNCTION__, '3.5.0' );
}
diff --git a/src/wp-includes/nav-menu-template.php b/src/wp-includes/nav-menu-template.php
index d90fdfa806..29d8a03944 100644
--- a/src/wp-includes/nav-menu-template.php
+++ b/src/wp-includes/nav-menu-template.php
@@ -324,7 +324,7 @@ function wp_nav_menu( $args = array() ) {
*
* @param array $menu_items The current menu item objects to which to add the class property information.
*/
-function _wp_menu_item_classes_by_context( &$menu_items ) {
+function _wp_menu_item_classes_by_context( $menu_items ) {
global $wp_query, $wp_rewrite;
$queried_object = $wp_query->get_queried_object();
diff --git a/src/wp-includes/pomo/entry.php b/src/wp-includes/pomo/entry.php
index e1b1c8f8c8..48c52384b1 100644
--- a/src/wp-includes/pomo/entry.php
+++ b/src/wp-includes/pomo/entry.php
@@ -114,7 +114,7 @@ if ( ! class_exists( 'Translation_Entry', false ) ) :
*
* @param Translation_Entry $other Other translation entry.
*/
- public function merge_with( &$other ) {
+ public function merge_with( $other ) {
$this->flags = array_unique( array_merge( $this->flags, $other->flags ) );
$this->references = array_unique( array_merge( $this->references, $other->references ) );
if ( $this->extracted_comments !== $other->extracted_comments ) {
diff --git a/src/wp-includes/pomo/po.php b/src/wp-includes/pomo/po.php
index de1bc92064..594ad80f4e 100644
--- a/src/wp-includes/pomo/po.php
+++ b/src/wp-includes/pomo/po.php
@@ -486,7 +486,7 @@ if ( ! class_exists( 'PO', false ) ) :
* @param Translation_Entry $entry
* @param string $po_comment_line
*/
- public function add_comment_to_entry( &$entry, $po_comment_line ) {
+ public function add_comment_to_entry( $entry, $po_comment_line ) {
$first_two = substr( $po_comment_line, 0, 2 );
$comment = trim( substr( $po_comment_line, 2 ) );
if ( '#:' === $first_two ) {
diff --git a/src/wp-includes/pomo/translations.php b/src/wp-includes/pomo/translations.php
index c4a9ba72d6..8d1a2183b9 100644
--- a/src/wp-includes/pomo/translations.php
+++ b/src/wp-includes/pomo/translations.php
@@ -130,7 +130,7 @@ if ( ! class_exists( 'Translations', false ) ) :
* @param Translation_Entry $entry Translation entry.
* @return Translation_Entry|false Translation entry if it exists, false otherwise.
*/
- public function translate_entry( &$entry ) {
+ public function translate_entry( $entry ) {
$key = $entry->key();
return $this->entries[ $key ] ?? false;
}
@@ -220,9 +220,9 @@ if ( ! class_exists( 'Translations', false ) ) :
*
* @since 2.8.0
*
- * @param Translations $other Another Translation object, whose translations will be merged in this one (passed by reference).
+ * @param Translations $other Another Translation object, whose translations will be merged in this one.
*/
- public function merge_with( &$other ) {
+ public function merge_with( $other ) {
foreach ( $other->entries as $entry ) {
$this->entries[ $entry->key() ] = $entry;
}
@@ -235,7 +235,7 @@ if ( ! class_exists( 'Translations', false ) ) :
*
* @param Translations $other
*/
- public function merge_originals_with( &$other ) {
+ public function merge_originals_with( $other ) {
foreach ( $other->entries as $entry ) {
if ( ! isset( $this->entries[ $entry->key() ] ) ) {
$this->entries[ $entry->key() ] = $entry;
diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
index f4b06958e0..cb7a91d56c 100644
--- a/src/wp-includes/post.php
+++ b/src/wp-includes/post.php
@@ -6309,10 +6309,10 @@ function get_page_hierarchy( $pages, $page_id = 0 ) {
* @see _page_traverse_name()
*
* @param int $page_id Page ID.
- * @param array $children Parent-children relations (passed by reference).
+ * @param array $children Parent-children relations.
* @param string[] $result Array of page names keyed by ID (passed by reference).
*/
-function _page_traverse_name( $page_id, &$children, &$result ) {
+function _page_traverse_name( $page_id, $children, &$result ) {
if ( isset( $children[ $page_id ] ) ) {
foreach ( (array) $children[ $page_id ] as $child ) {
$result[ $child->ID ] = $child->post_name;
@@ -7678,9 +7678,9 @@ function _get_last_post_time( $timezone, $field, $post_type = 'any' ) {
*
* @since 1.5.1
*
- * @param WP_Post[] $posts Array of post objects (passed by reference).
+ * @param WP_Post[] $posts Array of post objects.
*/
-function update_post_cache( &$posts ) {
+function update_post_cache( $posts ) {
if ( ! $posts ) {
return;
}
@@ -7762,12 +7762,12 @@ function clean_post_cache( $post ) {
*
* @since 1.5.0
*
- * @param WP_Post[] $posts Array of post objects (passed by reference).
+ * @param WP_Post[] $posts Array of post objects.
* @param string $post_type Optional. Post type. Default 'post'.
* @param bool $update_term_cache Optional. Whether to update the term cache. Default true.
* @param bool $update_meta_cache Optional. Whether to update the meta cache. Default true.
*/
-function update_post_caches( &$posts, $post_type = 'post', $update_term_cache = true, $update_meta_cache = true ) {
+function update_post_caches( $posts, $post_type = 'post', $update_term_cache = true, $update_meta_cache = true ) {
// No point in doing all this work if we didn't match any posts.
if ( ! $posts ) {
return;
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Core ticket: https://core.trac.wordpress.org/ticket/64643