Skip to content

Add Universal attribute and whitespace sniffs#56

Merged
dereuromark merged 3 commits intomasterfrom
feature/universal-attribute-whitespace-sniffs
Apr 10, 2026
Merged

Add Universal attribute and whitespace sniffs#56
dereuromark merged 3 commits intomasterfrom
feature/universal-attribute-whitespace-sniffs

Conversation

@dereuromark
Copy link
Copy Markdown
Contributor

Summary

Covers gaps in the current ruleset for PHP 8 attributes and whitespace — none of these are covered by existing Slevomat/Generic/PSR rules.

Attributes

  • `Universal.Attributes.BracketSpacing` — spacing inside `#[…]`
  • `Universal.Attributes.DisallowAttributeParentheses` — drop `()` from param-less attributes (`#[Foo]` not `#[Foo()]`)
  • `Universal.Attributes.TrailingComma` — trailing comma rules for multi-line attributes

Whitespace

  • `Universal.WhiteSpace.AnonClassKeywordSpacing` — spacing after `class` in `new class (…) extends …`
  • `Universal.WhiteSpace.FirstClassCallableSpacing` — spacing in `strlen(...)` first-class-callable syntax
  • `Universal.WhiteSpace.DisallowInlineTabs` — forbids tabs mid-line (complements existing `Generic.WhiteSpace.DisallowTabIndent` which only covers indent)

Related to #53.

`composer cs-check`, `composer test`, `composer stan` and `composer docs` all pass locally.

dereuromark and others added 3 commits April 10, 2026 17:54
Covers gaps in current ruleset for PHP 8 attributes and whitespace:

Attributes:
- Universal.Attributes.BracketSpacing
- Universal.Attributes.DisallowAttributeParentheses
- Universal.Attributes.TrailingComma

Whitespace:
- Universal.WhiteSpace.AnonClassKeywordSpacing
- Universal.WhiteSpace.FirstClassCallableSpacing
- Universal.WhiteSpace.DisallowInlineTabs
@dereuromark dereuromark merged commit 95da857 into master Apr 10, 2026
4 checks passed
@dereuromark dereuromark deleted the feature/universal-attribute-whitespace-sniffs branch April 10, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant