Skip to content

Commit

Permalink
PSR2/ClassDeclaration: add test with close brace followed by PHP clos…
Browse files Browse the repository at this point in the history
…e 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.
  • Loading branch information
jrfnl committed Jul 20, 2024
1 parent 1d4c9d2 commit 8303a3f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -338,3 +338,9 @@ $foo->bar(
// ...
},
);

enum BraceNotOnLineByItselfCloseTagError
{
} ?>

<?php
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,9 @@ $foo->bar(
// ...
},
);

enum BraceNotOnLineByItselfCloseTagError
{
} ?>

<?php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public function getErrorList()
310 => 1,
316 => 1,
324 => 1,
344 => 1,
];

}//end getErrorList()
Expand Down

0 comments on commit 8303a3f

Please sign in to comment.