PHP attributes declared without arguments must (not) be followed by empty parentheses.
Whether attributes should be followed by parentheses or not.
Allowed types: bool
Default value: false
Default configuration.
--- Original
+++ New
<?php
-#[Foo()]
+#[Foo]
class Sample1 {}
-#[Bar(), Baz()]
+#[Bar, Baz]
class Sample2 {}
With configuration: ['use_parentheses' => true]
.
--- Original
+++ New
<?php
-#[Foo]
+#[Foo()]
class Sample1 {}
-#[Bar, Baz]
+#[Bar(), Baz()]
class Sample2 {}
- Fixer class: PhpCsFixer\Fixer\AttributeNotation\AttributeEmptyParenthesesFixer
- Test class: PhpCsFixer\Tests\Fixer\AttributeNotation\AttributeEmptyParenthesesFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.