Skip to content

Conversation

rodrigoprimo
Copy link
Contributor

@rodrigoprimo rodrigoprimo commented Apr 2, 2025

Description

Generic/UselessOverridingMethod: fix syntax errors in the documentation

This commit fixes two syntax errors in the PHP code examples in the sniff documentation.

Previously, the provided code would cause the following PHP error:

PHP Fatal error: Cannot use "parent" when current class scope has no parent

Generic/UselessOverridingMethod: improve documentation description and titles

  • <documentation> title now matches the sniff title.
  • <standard> description uses 'discouraged' instead of 'should not' as this sniff raises a warning, not an error.
  • Minor grammar fixes and small changes to hopefully improve the readability of the <standard> description and <code> titles.

Suggested changelog entry

Generic.CodeAnalysis.UselessOverridingMethod: minor fixes and improvements to the XML documentation

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
    • This change is only breaking for integrators, not for external standards or end-users.
  • Documentation improvement

PR checklist

  • I have checked there is no other PR open for the same change.
  • I have read the Contribution Guidelines.
  • I grant the project the right to include and distribute the code under the BSD-3-Clause license (and I have the right to grant these rights).
  • I have added tests to cover my changes.
  • I have verified that the code complies with the projects coding standards.
  • [Required for new sniffs] I have added XML documentation for the sniff.

This commit fixes two syntax errors in the PHP code examples in the
sniff documentation.

Previously, the provided code would cause the following PHP error:

```
PHP Fatal error: Cannot use "parent" when current class scope has no
parent
```
titles

- <documentation> title now matches the sniff title.
- <standard> description uses 'discouraged' instead of 'should not' as
this sniff raises a warning and not an error.
- Minor grammar fixes and small changes to hopefully improve the
readability of the <standard> description and <code> titles.
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 @rodrigoprimo ! LGTM.

'discouraged' instead of 'should not'

For the record: both those terms/phrases are appropriate for warnings.
For errors, the phrasing can be more along the lines of 'must not'.

@jrfnl jrfnl added this to the 3.12.1 milestone Apr 2, 2025
@jrfnl jrfnl merged commit 835d578 into PHPCSStandards:master Apr 2, 2025
48 checks passed
@jrfnl jrfnl deleted the documentation-useless-overriding-method-minor-fix branch April 2, 2025 21:56
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