Skip to content

Commit fcd6982

Browse files
Add attributes check to ScopeIndentSniff
1 parent 0fd66d3 commit fcd6982

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

coder_sniffer/Drupal/Sniffs/WhiteSpace/ScopeIndentSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,7 @@ public function process(File $phpcsFile, $stackPtr)
962962
T_OPEN_CURLY_BRACKET,
963963
T_COLON,
964964
T_OPEN_TAG,
965+
T_ATTRIBUTE_END,
965966
]
966967
) === false
967968
) {

tests/Drupal/bad/bad.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,26 @@ function test28() {
838838
enum aBad_NameForAnEnum {
839839
}
840840

841+
/**
842+
* Test PHP attributes.
843+
*/
844+
class TestPhpAttributes {
845+
846+
/**
847+
* Bar property.
848+
*/
849+
#[NotBlank]
850+
private bool $bar;
851+
852+
/**
853+
* Tests method with PHP attribute and docblock.
854+
*/
855+
#[\ReturnTypeWillChange]
856+
public function attributes(): void {
857+
}
858+
859+
}
860+
841861
/**
842862
* A test class.
843863
*/

0 commit comments

Comments
 (0)