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

Bug #20386 Squiz.Commenting.ClassComment.SpacingBefore thrown if first block comment
Submitted: 2014-09-04 22:26 UTC
From: bkdotcom Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.5.4)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    

 [2014-09-04 22:26 UTC] bkdotcom (Brad Kent)
Description: ------------ Squiz.Commenting.ClassComment.SpacingBefore error is thrown if the file does not contain a fileComment Test script: --------------- <?php /** * I'm a class comment * There is exactly one blank line before this comment */ class ClassCommentTest { } Expected result: ---------------- Squiz.Commenting.ClassComment.SpacingBefore should not be triggered Actual result: -------------- 2 | ERROR | There must be exactly one blank line before the class comment | | (Squiz.Commenting.ClassComment.SpacingBefore)


 [2014-09-04 22:45 UTC] bkdotcom (Brad Kent)
In my case, I've made file-comments optional by assigning Squiz.Commenting.FileComment.Missing a low severity FileCommentSniff looks for zero (0) blank lines between T_OPEN_TAG and the file comment For consistency, perhaps ClassCommentSniff should also look for zero blank lines if the class comment is first ?
 [2014-09-05 06:05 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Fix committed to github repo: 4287cef5846d10 More info on the PR: