Skip to content

Commit cae56af

Browse files
committed
Add test to demonstrate bug
1 parent ed8e00d commit cae56af

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,3 +1046,11 @@ public function ignored() {
10461046
* @return void
10471047
* @throws Exception If any other error occurs. */
10481048
function throwCommentOneLine() {}
1049+
1050+
/**
1051+
* When two adjacent pipe symbols are used (by mistake), the sniff should not throw a PHP Fatal error
1052+
*
1053+
* @param stdClass||null $object While invalid, this should not throw a PHP Fatal error.
1054+
* @return void
1055+
*/
1056+
function doublePipeFatalError(?stdClass $object) {}

src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,3 +1046,11 @@ public function ignored() {
10461046
* @return void
10471047
* @throws Exception If any other error occurs. */
10481048
function throwCommentOneLine() {}
1049+
1050+
/**
1051+
* When two adjacent pipe symbols are used (by mistake), the sniff should not throw a PHP Fatal error
1052+
*
1053+
* @param stdClass||null $object While invalid, this should not throw a PHP Fatal error.
1054+
* @return void
1055+
*/
1056+
function doublePipeFatalError(?stdClass $object) {}

0 commit comments

Comments
 (0)