Tracking: PHPStan Remediations - #1
Open
justlevine wants to merge 35 commits into
Open
Conversation
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. |
justlevineforce-pushed
the
chore/phpstan/level-0
branch
from
May 10, 2025 14:27
ba1b7ed to
6c9e72bComparejustlevineforce-pushed
the
feat/phpstan
branch
2 times, most recently
from
May 23, 2025 16:46
6695813 to
947a5feComparejustlevineforce-pushed
the
chore/phpstan/level-0
branch
from
May 23, 2025 17:59
682af29 to
7a29cd9Comparejustlevineforce-pushed
the
chore/phpstan/level-0
branch
3 times, most recently
from
May 31, 2025 18:22
2ea3189 to
0802ccaComparejustlevineforce-pushed
the
chore/phpstan/level-0
branch
from
June 1, 2025 16:31
f69ef87 to
c575bbbComparejustlevineforce-pushed
the
chore/phpstan/level-0
branch
2 times, most recently
from
June 12, 2025 21:55
e4cbd2f to
3277cd6Comparejustlevineforce-pushed
the
chore/phpstan/level-0
branch
from
June 18, 2025 17:53
3277cd6 to
7a54a48Comparejustlevineforce-pushed
the
feat/phpstan
branch
2 times, most recently
from
June 28, 2025 07:40
47d4cd2 to
f1f214dComparejustlevineforce-pushed
the
chore/phpstan/level-0
branch
2 times, most recently
from
June 28, 2025 09:43
bec2a94 to
bee227bComparejustlevineforce-pushed
the
chore/phpstan/level-0
branch
from
July 8, 2025 22:24
bee227b to
738b3b5Comparejustlevineforce-pushed
the
chore/phpstan/level-0
branch
from
July 19, 2025 16:45
738b3b5 to
03e7452Comparejustlevineforce-pushed
the
chore/phpstan/level-0
branch
from
July 26, 2025 09:00
a199310 to
80d3039Compare….php, WP_Posts_List_Table, and WP_Screen
It's the entrypoint into this codeblock two lines above
…gs_Registry::register()
remove_query_arg() only takes `string|string[]`. Added a comment because it took me 5 minutes to understand _why_ we were using
justlevineforce-pushed
the
chore/phpstan/level-0
branch
from
October 24, 2025 21:37
80d3039 to
edabf22Compare…_REST_Attachments_Controller::edit_media_item() see: WordPress@117f23f#r168784907
justlevine pushed a commit
that referenced
this pull request
Mar 16, 2026
…om `previous_posts()`. The `esc_url()` function expects to a string for `$url` parameter. There is no input validation within that function. The function contains a `ltrim()` which also expects a string. Passing `null` to this parameter results in `Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated` notice on PHP 8.1+. Tracing the stack back, a `null` is being passed to it within `previous_posts()` when `get_previous_posts_page_link()` returns `null` (it can return a string or `null`). On PHP 7.0 to PHP 8.x, an empty string is returned from `esc_url()` when `null` is passed to it. The change in this changeset avoids the deprecation notice by not invoking `esc_url()` when `get_previous_posts_page_link()` returns `null` and instead sets the `$output` to an empty string, thus maintaining the same behavior as before (minus the deprecation notice). Adds a test to validate an empty string is returned and the absence of the deprecation (when running on PHP 8.1+). Follow-up to [9632], [11383], [56740]. Props dd32, alexodiy. Fixes #64864. git-svn-id: https://develop.svn.wordpress.org/trunk@62034 602fd350-edb4-49c9-b593-d223f7449a82
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 freeto 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.
Remediating PHPStan fixes in-situ.
Individual fixes are cherry-picked into separate PRs onto
trunk, and then removed from here when this is periodically rebased.Trac ticket:
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.