Fork me on GitHub
a Sensio Labs Product

BoY42 (v3.15.1) edition

Rule doctrine_annotation_braces

Doctrine annotations without arguments must use the configured syntax.



List of tags that must not be treated as Doctrine Annotations.

Allowed types: array

Default value: ['abstract', 'access', 'code', 'deprec', 'encode', 'exception', 'final', 'ingroup', 'inheritdoc', 'inheritDoc', 'magic', 'name', 'toc', 'tutorial', 'private', 'static', 'staticvar', 'staticVar', 'throw', 'api', 'author', 'category', 'copyright', 'deprecated', 'example', 'filesource', 'global', 'ignore', 'internal', 'license', 'link', 'method', 'package', 'param', 'property', 'property-read', 'property-write', 'return', 'see', 'since', 'source', 'subpackage', 'throws', 'todo', 'TODO', 'usedBy', 'uses', 'var', 'version', 'after', 'afterClass', 'backupGlobals', 'backupStaticAttributes', 'before', 'beforeClass', 'codeCoverageIgnore', 'codeCoverageIgnoreStart', 'codeCoverageIgnoreEnd', 'covers', 'coversDefaultClass', 'coversNothing', 'dataProvider', 'depends', 'expectedException', 'expectedExceptionCode', 'expectedExceptionMessage', 'expectedExceptionMessageRegExp', 'group', 'large', 'medium', 'preserveGlobalState', 'requires', 'runTestsInSeparateProcesses', 'runInSeparateProcess', 'small', 'test', 'testdox', 'ticket', 'uses', 'SuppressWarnings', 'noinspection', 'package_version', 'enduml', 'startuml', 'psalm', 'phpstan', 'template', 'fix', 'FIXME', 'fixme', 'override']


Whether to add or remove braces.

Allowed values: 'with_braces', 'without_braces'

Default value: 'without_braces'


Example #1

Default configuration.

--- Original
+++ New
- * @Foo()
+ * @Foo
 class Bar {}

Example #2

With configuration: ['syntax' => 'with_braces'].

--- Original
+++ New
- * @Foo
+ * @Foo()
 class Bar {}

Rule sets

The rule is part of the following rule set:


Using the @DoctrineAnnotation rule set will enable the doctrine_annotation_braces rule with the default config.

The logo is © 2010-2022 Sensio Labs