Rule attribute_block_no_spaces¶
Remove spaces before and after the attributes block.
Examples¶
Example #1¶
--- Original
+++ New
<?php
class User
{
- #[
- ApiProperty(identifier: true)
- ]
+ #[ApiProperty(identifier: true)]
private string $name;
}
Rule sets¶
The rule is part of the following rule sets:
@PER (deprecated)
@PER-CS2.0 (deprecated)
@PER-CS3.0 (deprecated)
References¶
Fixer class: PhpCsFixer\Fixer\AttributeNotation\AttributeBlockNoSpacesFixer
Test class: PhpCsFixer\Tests\Fixer\AttributeNotation\AttributeBlockNoSpacesFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.