Removes ignored errors from 4 phpstan baseline files and fixes their errors - #13069
Removes ignored errors from 4 phpstan baseline files and fixes their errors#13069dpanta94 wants to merge 2 commits into
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. |
c126a52 to
28772c5
Compare
|
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. |
279f0e2 to
4459ea8
Compare
More specifically removes baselines deadCode.unreachable.neon, if.alwaysTrue.neon, while.alwaysFalse.neon and while.alwaysTrue.neon
4459ea8 to
986fda1
Compare
Removes in total
104errorsRemoves errors from the below phpstan baselines and fixes the issues that they were covering:
How ?
Marks the
have_comments()andhave_posts()methods as impure since they can change their return type based on the state of a speficicWP_Queryinstance or the global'sWP_Queryinstance.In the file
src/wp-content/themes/twentyfourteen/inc/widgets.phpmoves the$tmp_moredefinition out of the while loop$ephemera->have_posts(). This was a bug, since it would guarantee thatGLOBALS['more']and the$tmp_morewould be overwritten to 0 if there were at least 2 loops.Loom showing the bug https://www.loom.com/share/c713c48d553b4e6abfdb3e2b9b5f2cf7
Trac ticket: https://core.trac.wordpress.org/ticket/65817
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Opus 5
Used for: Help with suggesting how to fix the phpstan output for the specific errors we are removing the baselines for. The actual result has been reviewed and are owned by me.
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.