Rule doctrine_annotation_indentation
¶
Doctrine annotations must be indented with four spaces.
Configuration¶
indent_mixed_lines
¶
Whether to indent lines that have content before closing parenthesis.
Allowed types: bool
Default value: false
Examples¶
Example #1¶
Default configuration.
--- Original
+++ New
<?php
/**
- * @Foo(
- * foo="foo"
- * )
+ * @Foo(
+ * foo="foo"
+ * )
*/
class Bar {}
Example #2¶
With configuration: ['indent_mixed_lines' => true]
.
--- Original
+++ New
<?php
/**
- * @Foo({@Bar,
- * @Baz})
+ * @Foo({@Bar,
+ * @Baz})
*/
class Bar {}
Rule sets¶
The rule is part of the following rule set:
References¶
Fixer class: PhpCsFixer\Fixer\DoctrineAnnotation\DoctrineAnnotationIndentationFixer
Test class: PhpCsFixer\Tests\Fixer\DoctrineAnnotation\DoctrineAnnotationIndentationFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.