Skip to content

PHP/NoSilencedErrors: add XML documentation#2694

Open
rodrigoprimo wants to merge 3 commits intoWordPress:developfrom
rodrigoprimo:docs-php-no-silenced-errors
Open

PHP/NoSilencedErrors: add XML documentation#2694
rodrigoprimo wants to merge 3 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.

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.

2 participants