Skip to content

Commit 8303a3f

Browse files
committed
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.
1 parent 1d4c9d2 commit 8303a3f

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,3 +338,9 @@ $foo->bar(
338338
// ...
339339
},
340340
);
341+
342+
enum BraceNotOnLineByItselfCloseTagError
343+
{
344+
} ?>
345+
346+
<?php

src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc.fixed

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,3 +327,9 @@ $foo->bar(
327327
// ...
328328
},
329329
);
330+
331+
enum BraceNotOnLineByItselfCloseTagError
332+
{
333+
} ?>
334+
335+
<?php

src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public function getErrorList()
7979
310 => 1,
8080
316 => 1,
8181
324 => 1,
82+
344 => 1,
8283
];
8384

8485
}//end getErrorList()

0 commit comments

Comments
 (0)