Skip to content

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Nov 11, 2025

This sniff enforces that attribute instantiations only use parentheses when parameters are passed to the attribute constructor.

This sniff can be used to address the following rule from PER-CS:

12.1 Basics
...
If an attribute has no arguments, the () MUST be omitted.

Ref: https://www.php-fig.org/per/coding-style/#121-basics

Includes fixer.
Includes metrics.
Includes unit tests.
Includes documentation.

Related to #387

This sniff enforces that attribute instantiations only use parentheses when parameters are passed to the attribute constructor.

This sniff can be used to address the following rule from PER-CS:

> 12.1 Basics
> ...
> If an attribute has no arguments, the `()` MUST be omitted.

Ref: https://www.php-fig.org/per/coding-style/#121-basics

Includes fixer.
Includes unit tests.
Includes documentation.

Related to 387
@jrfnl jrfnl added this to the 1.5.0 milestone Nov 11, 2025
@jrfnl jrfnl merged commit 0ff35cd into develop Nov 11, 2025
90 checks passed
@jrfnl jrfnl deleted the feature/387-new-universal-disallow-attribute-parentheses-sniff branch November 11, 2025 01:46
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