Rule doctrine_annotation_array_assignment
¶
Doctrine annotations must use configured operator for assignment in arrays.
Configuration¶
operator
¶
The operator to use.
Allowed values: ':'
and '='
Default value: '='
Examples¶
Example #1¶
Default configuration.
--- Original
+++ New
<?php
/**
- * @Foo({bar : "baz"})
+ * @Foo({bar = "baz"})
*/
class Bar {}
Example #2¶
With configuration: ['operator' => ':']
.
--- Original
+++ New
<?php
/**
- * @Foo({bar = "baz"})
+ * @Foo({bar : "baz"})
*/
class Bar {}
Rule sets¶
The rule is part of the following rule set:
@DoctrineAnnotation with config:
['operator' => ':']
References¶
Fixer class: PhpCsFixer\Fixer\DoctrineAnnotation\DoctrineAnnotationArrayAssignmentFixer
Test class: PhpCsFixer\Tests\Fixer\DoctrineAnnotation\DoctrineAnnotationArrayAssignmentFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.