Rule doctrine_annotation_braces
¶
Doctrine annotations without arguments must use the configured syntax.
Configuration¶
syntax
¶
Whether to add or remove braces.
Allowed values: 'with_braces'
and 'without_braces'
Default value: 'without_braces'
Examples¶
Example #1¶
Default configuration.
--- Original
+++ New
<?php
/**
- * @Foo()
+ * @Foo
*/
class Bar {}
Example #2¶
With configuration: ['syntax' => 'with_braces']
.
--- Original
+++ New
<?php
/**
- * @Foo
+ * @Foo()
*/
class Bar {}
Rule sets¶
The rule is part of the following rule set:
References¶
Fixer class: PhpCsFixer\Fixer\DoctrineAnnotation\DoctrineAnnotationBracesFixer
Test class: PhpCsFixer\Tests\Fixer\DoctrineAnnotation\DoctrineAnnotationBracesFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.