Skip to content

Comments

code quality: add explicit : void to method signatures in wp-signup.php, WP_Posts_List_Table, and WP_Screen#8965

Open
justlevine wants to merge 4 commits intoWordPress:trunkfrom
justlevine:chore/void-return-types-ex
Open

code quality: add explicit : void to method signatures in wp-signup.php, WP_Posts_List_Table, and WP_Screen#8965
justlevine wants to merge 4 commits intoWordPress:trunkfrom
justlevine:chore/void-return-types-ex

Conversation

@justlevine
Copy link

This PR updates the method signatures of several functions and files to enforce a : void return type. Changes are non-breaking and unlikely to disrupt other open PRs.

More specifically:

  • wp-signup.php : an example of global functions (cant be overwritten)
  • WP_Posts_List_Table : an example of private methods (don't get inherited)
  • WP_Screen : an example of methods on a final class (cant be extended)

While surfaced and part of PHPStan efforts (https://core.trac.wordpress.org/ticket/61175 / #7619 ), this PR serves as proof of concept for a larger proposal that would see : void return types implemented across the codebase in a nondisruptive manner while lay the groundwork for safely implementing other return types to existing method signatures.

Trac ticket: https://core.trac.wordpress.org/ticket/63558


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions
Copy link

github-actions bot commented Jun 12, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props justlevine, westonruter.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link

Test using WordPress Playground

The 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

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@justlevine justlevine force-pushed the chore/void-return-types-ex branch from b6f10b5 to e8a81e7 Compare August 16, 2025 23:14
@github-actions

This comment was marked as off-topic.

@github-actions github-actions bot closed this Feb 20, 2026
@justlevine
Copy link
Author

@westonruter should this have been closed by the phpstan level 0 commit?

@westonruter
Copy link
Member

No! 😢

@westonruter westonruter reopened this Feb 20, 2026
westonruter and others added 2 commits February 22, 2026 22:32
Specifically for set_screen_reader_content() and remove_screen_reader_content().

Co-authored-by: gemini-cli <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants