PHP_CodeSniffer icon indicating copy to clipboard operation
PHP_CodeSniffer copied to clipboard

fix(ScopeKeywordSpacing): Check spaces after final keyword

Open klausi opened this issue 5 months ago • 4 comments

The spacing after the final keyword should be checked by ScopeKeywordSpacingSniff.

Description

This should throw an error because there are 6 spaces after final:

class FinalTest {
    final      public static function create(ContainerInterface $container) {}
}

Suggested changelog entry

Fixed bug XYZ : Squiz.WhiteSpace.ScopeKeywordSpacing detect white space problems after final keyword.

Related issues/external references

Fir reported at Drupal's coder: https://www.drupal.org/project/coder/issues/3468410

Types of changes

Bug fix

PR checklist

  • [x] I have checked there is no other PR open for the same change.
  • [x] I have read the Contribution Guidelines.
  • [x] 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).
  • [x] I have added tests to cover my changes.
  • [x] I have verified that the code complies with the projects coding standards.

klausi avatar Sep 01 '24 16:09 klausi