[PEAR-BUG] Bug #20386 [Opn->Csd]: Squiz.Commenting.ClassComment.SpacingBefore thrown if first block comment

[email protected]
Newsgroups php.pear.bugs
Message-ID <[email protected]>
Edit report at https://pear.php.net/bugs/bug.php?id=20386&edit=1

 ID:               20386
 Updated by:       [email protected]
 Reported By:      bkfake-php at yahoo dot com
 Summary:          Squiz.Commenting.ClassComment.SpacingBefore thrown if
                    first block comment
-Status:           Open
+Status:           Closed
 Type:             Bug
 Package:          PHP_CodeSniffer
 Operating System: Irrelevant
 Package Version:  1.5.4
 PHP Version:      Irrelevant
-Assigned To:      
+Assigned To:      squiz
 Roadmap Versions: 
 New Comment:

-Status:      Open
+Status:      Closed
-Assigned To:
+Assigned To: squiz
Fix committed to github repo: 
https://github.com/squizlabs/PHP_CodeSniffer/commit/0e1d9297c4bb20875b18297181
4287cef5846d10

More info on the PR:
https://github.com/squizlabs/PHP_CodeSniffer/pull/247


Previous Comments:
------------------------------------------------------------------------

[2014-09-04 18:45:07] bkdotcom

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-04 18:26:23] bkdotcom

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)

------------------------------------------------------------------------


-- 
Edit this bug report at https://pear.php.net/bugs/bug.php?id=20386&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.