Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.7.2

Bug #20381 Invalid "Comment closer must be on a new line"
Submitted: 2014-08-30 02:30 UTC
From: bkdotcom Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.5.4)
PHP Version: 5.4.13 OS: Win 7 x64
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 13 + 11 = ?

 
 [2014-08-30 02:30 UTC] bkdotcom (Brad Kent)
Description: ------------ It seems a "post statement comment" following a block comment improperly throws this error. I have excluded the BlockComment.NoEmptyLineAfter and PostStatementComment.Found sniffs which should leave the test script error free Test script: --------------- /* I am excluding two Sniffs: + Squiz.Commenting.BlockComment.NoEmptyLineAfter + Squiz.Commenting.PostStatementComment.Found */ $two = 1 + 1; // I'm not a comment closer! Expected result: ---------------- should not throw "Comment closer must be on a new line" error Actual result: -------------- Comment closer must be on a new line (Squiz.Commenting.BlockComment)

Comments

 [2014-08-30 02:48 UTC] bkdotcom (Brad Kent)
Another false positive, this one doesn't even have a block comment $two = 1 + 1; // math is hard // writing sniffs is also hard
 [2014-08-30 02:53 UTC] bkdotcom (Brad Kent)
Scratch that last comment... there is, in fact a block comment above a chain of single line comments... /* block comment */ $two = 1 + 1; // math is hard // I'm not a closer! so... it's very similar to my original report
 [2014-08-30 03:32 UTC] bkdotcom (Brad Kent)
pull request submitted to GitHub: Standards/Squiz/Sniffs/Commenting/ClockCommentSniff.php
 [2014-09-01 06:25 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Thanks for the PR. Merged and pushed.