Skip to content

PHP/NoSilencedErrors: add XML documentation#2694

Merged
dingo-d merged 5 commits intoWordPress:developfrom
rodrigoprimo:docs-php-no-silenced-errors
Feb 25, 2026
Merged

PHP/NoSilencedErrors: add XML documentation#2694
dingo-d merged 5 commits intoWordPress:developfrom
rodrigoprimo:docs-php-no-silenced-errors

Conversation

@rodrigoprimo
Copy link
Collaborator

Description

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

The documentation is based on the work started by @gogdzl in #2495. I squashed the original commit and, in a separate commit, applied the changes suggested during the review of #2495:

  • Fix the title to match the sniff name.
  • Use "should not" since the sniff produces a warning (RFC 2119).
  • Be specific about the @ operator in the standard description.
  • Mention the exception for certain functions without listing them.
  • Remove the allowed functions list from the description.
  • Simplify the code examples to focus on the presence/absence of @.
  • Rename the variable from $conn_id to $connection.

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

Suggested changelog entry

N/A

Related issues/external references

Related to: #1722
Supersedes: #2495
Closes #2495

gogdzl and others added 2 commits February 4, 2026 10:22
- Fix the title to match the sniff name.
- Be specific about the @ operator in the standard description.
- Mention the exception for certain functions without listing them.
- Simplify the code examples to focus on the presence/absence of @.
- Rename the variable from $conn_id to $connection as
`ftp_connect()` does not return a connection ID.
Following the suggestion in PR 2687, improve the standard
description to explain why the error silencing operator should
not be used instead of just repeating the rule.
@rodrigoprimo
Copy link
Collaborator Author

Just noting here that, following what was suggested in #2687 (review), I added a new commit that expands the standard description to explain why the rule exists.

Copy link
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 ! Left you some feedback inline.

Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>
@rodrigoprimo rodrigoprimo force-pushed the docs-php-no-silenced-errors branch from 78d5bd2 to 019e0bb Compare February 23, 2026 19:01
@rodrigoprimo
Copy link
Collaborator Author

Thanks, @jrfnl. I replied to or accepted all your remarks, and this PR is ready for another look when you get a chance.

Copy link
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.

🎉 Happy to see this one merged. Looks good to me now.

@jrfnl
Copy link
Member

jrfnl commented Feb 24, 2026

For whomever does the second review: please squashmerge.

@jrfnl jrfnl modified the milestones: 3.3.x, 3.4.0 Feb 24, 2026
@jrfnl jrfnl mentioned this pull request Feb 24, 2026
61 tasks
@dingo-d dingo-d merged commit c580c6c into WordPress:develop Feb 25, 2026
31 checks passed
@rodrigoprimo rodrigoprimo deleted the docs-php-no-silenced-errors branch February 25, 2026 14:29
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