diff --git a/coder_sniffer/Drupal/Sniffs/WhiteSpace/ScopeIndentSniff.php b/coder_sniffer/Drupal/Sniffs/WhiteSpace/ScopeIndentSniff.php index 6da012eb..f2b04020 100644 --- a/coder_sniffer/Drupal/Sniffs/WhiteSpace/ScopeIndentSniff.php +++ b/coder_sniffer/Drupal/Sniffs/WhiteSpace/ScopeIndentSniff.php @@ -962,6 +962,7 @@ public function process(File $phpcsFile, $stackPtr) T_OPEN_CURLY_BRACKET, T_COLON, T_OPEN_TAG, + T_ATTRIBUTE_END, ] ) === false ) { diff --git a/tests/Drupal/WhiteSpace/ScopeIndentUnitTest.inc b/tests/Drupal/WhiteSpace/ScopeIndentUnitTest.inc index 582df387..7b753fd1 100644 --- a/tests/Drupal/WhiteSpace/ScopeIndentUnitTest.inc +++ b/tests/Drupal/WhiteSpace/ScopeIndentUnitTest.inc @@ -203,3 +203,22 @@ $has_index_value_scalar['foo']['value'] = array ( EXPECTED ], ]; + +/** + * Test PHP attributes. + */ +class TestPhpAttributes { + + /** + * Bar property. + */ + #[NotBlank] + private bool $bar; + + /** + * Tests method with PHP attribute and docblock. + */ + #[\ReturnTypeWillChange] + public function attributes(): void {} + +} diff --git a/tests/Drupal/WhiteSpace/ScopeIndentUnitTest.inc.fixed b/tests/Drupal/WhiteSpace/ScopeIndentUnitTest.inc.fixed index 4c74f205..a1b3fa4d 100644 --- a/tests/Drupal/WhiteSpace/ScopeIndentUnitTest.inc.fixed +++ b/tests/Drupal/WhiteSpace/ScopeIndentUnitTest.inc.fixed @@ -215,3 +215,22 @@ $has_index_value_scalar['foo']['value'] = array ( EXPECTED ], ]; + +/** + * Test PHP attributes. + */ +class TestPhpAttributes { + + /** + * Bar property. + */ + #[NotBlank] + private bool $bar; + + /** + * Tests method with PHP attribute and docblock. + */ + #[\ReturnTypeWillChange] + public function attributes(): void {} + +}