Skip to content

PHP/DevelopmentFunctions: add XML documentation#2690

Merged
dingo-d merged 4 commits into
WordPress:developfrom
rodrigoprimo:docs-php-development-functions
Feb 4, 2026
Merged

PHP/DevelopmentFunctions: add XML documentation#2690
dingo-d merged 4 commits into
WordPress:developfrom
rodrigoprimo:docs-php-development-functions

Conversation

@rodrigoprimo
Copy link
Copy Markdown
Contributor

@rodrigoprimo rodrigoprimo commented Feb 2, 2026

Description

This PR adds XML documentation for the WordPress.PHP.DevelopmentFunctions sniff.

The documentation is based on the work started by @gogdzl in #2490. I used the original commits and then made subsequent changes, mostly based on the review left in #2490.

I suggest squashing those commits before merging. I'm opening the PR without doing that to make it easier to tell my changes apart from the original changes.

I opted to remove the function lists from the standard descriptions to avoid the maintenance burden of keeping docs in sync when functions are added or removed. Also, this approach is consistent with other similar sniffs like DB/RestrictedFunctions and WP/DeprecatedFunctions that also don't list all flagged functions.

Suggested changelog entry

N/A

Related issues/external references

Related to: #1722
Supersedes: #2490
Closes: #2490

gogdzl and others added 2 commits February 2, 2026 16:29
- Change standard descriptions to be more direct.
- Remove function lists from standard descriptions.
- Fix "(Not)" in titles to "Not using...".
- Make titles and comments more generic.
- Fix typo `php_info()` to `phpinfo()`.
- Use "full path disclosure" consistently.
Copy link
Copy Markdown
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on @rodrigoprimo !

When looking at these docs, I have a feeling that the code comparisons don't actually add any value in this case.

There is precedent for XML docs only containing <standard> blocks (for example), so I wonder if we should consider that for this sniff.

Maybe in combination with one or two examples of the discouraged functions in the <standard> description ? (not the complete list to prevent a maintenance nightmare as you rightly pointed out, but just a few examples).

Copy link
Copy Markdown
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rodrigoprimo
Copy link
Copy Markdown
Contributor Author

Thanks for the review, @jrfnl!

I first removed the code_comparison blocks and added a couple of example functions to each <standard> description. However, the two standard blocks felt a bit disconnected when rendered as standalone paragraphs, so in a second commit, I merged them into a single <standard> block. I left both commits so you can compare the two approaches.

This PR is ready for another look when you get a chance.

@rodrigoprimo
Copy link
Copy Markdown
Contributor Author

@jrfnl, I posted the comment above before realizing you had already reviewed my first commit and approved the PR. Let me know which approach you prefer. Happy to revert to the previous one.

@jrfnl
Copy link
Copy Markdown
Member

jrfnl commented Feb 3, 2026

I have no strong preference between these two versions. Maybe the second reviewer does.

@dingo-d dingo-d merged commit 3ee819c into WordPress:develop Feb 4, 2026
31 checks passed
@rodrigoprimo rodrigoprimo deleted the docs-php-development-functions branch February 4, 2026 12:01
@jrfnl jrfnl modified the milestones: 3.3.x, 3.4.0 Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants