From 8303a3fc5d7bd0cb1da5c3c4fc844fae700a384b Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 16 Jul 2024 01:18:58 +0200 Subject: [PATCH] PSR2/ClassDeclaration: add test with close brace followed by PHP close tag Related to 552 This adds a test to the sniff documenting that when a PHP close tag is on the same line as the OO close brace, the sniff will throw an error. In my opinion, this is the correct and expected behaviour. --- .../PSR2/Tests/Classes/ClassDeclarationUnitTest.inc | 6 ++++++ .../PSR2/Tests/Classes/ClassDeclarationUnitTest.inc.fixed | 6 ++++++ .../PSR2/Tests/Classes/ClassDeclarationUnitTest.php | 1 + 3 files changed, 13 insertions(+) diff --git a/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc b/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc index c2695983ec..1df40d5149 100644 --- a/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc +++ b/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc @@ -338,3 +338,9 @@ $foo->bar( // ... }, ); + +enum BraceNotOnLineByItselfCloseTagError +{ +} ?> + +bar( // ... }, ); + +enum BraceNotOnLineByItselfCloseTagError +{ +} ?> + + 1, 316 => 1, 324 => 1, + 344 => 1, ]; }//end getErrorList()