Docs: Replace void with null in union return types in Customize#11006
Docs: Replace void with null in union return types in Customize#11006apermo wants to merge 1 commit intoWordPress:trunkfrom
Conversation
Fixes #64701. See #64694. Co-Authored-By: xateman
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| * @return string|void | ||
| * @return string|null | ||
| */ | ||
| public function get_current_image_src() { |
There was a problem hiding this comment.
If $this->get_url didn't set then function didn;t return anything do we needs to return null after if statement?
There was a problem hiding this comment.
PHP's void type can not be part of a union type so it can either be only void or string|null etc.
There was a problem hiding this comment.
as @xateman said, we considered adding an return null; on those functions, but adding that would add clutter and barely any to no value. It might be considerable, but I think thats out of scope for this issue.
| * @return string|void | ||
| * @return string|null | ||
| */ | ||
| public function get_current_image_src() { |
There was a problem hiding this comment.
PHP's void type can not be part of a union type so it can either be only void or string|null etc.
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. |
Co-Authored-By: xateman
Trac ticket: https://core.trac.wordpress.org/ticket/64701
Use of AI Tools
Used AI for research, documentation and for the replacements. Everything was reviewed by myself and @xateman before opening this PR.
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.