[PEAR-BUG] Bug #20375 [Opn->Csd]: PHP closing tag check in SuperfluousWhitespace Sniff doesn't detect newline

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

 ID:               20375
 Updated by:       [email protected]
 Reported By:      pear at kennel17 dot co dot uk
 Summary:          PHP closing tag check in SuperfluousWhitespace Sniff
                    doesn't detect newline
-Status:           Open
+Status:           Closed
 Type:             Bug
 Package:          PHP_CodeSniffer
 Package Version:  2.0.0RC1
 PHP Version:      Irrelevant
-Assigned To:      
+Assigned To:      squiz
 Roadmap Versions: 
 New Comment:

-Status:      Open
+Status:      Closed
-Assigned To:
+Assigned To: squiz
Sniff is working as expected. See PR for discussion.


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

[2014-08-24 09:13:17] happydog

I have created a pull request to fix this:

https://github.com/squizlabs/PHP_CodeSniffer/pull/231

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

[2014-08-24 09:08:17] happydog

Description:
------------
Squiz_Sniffs_WhiteSpace_SuperfluousWhitespaceSniff does not detect a
single newline at the end of the file.  This is because the newline is
included in the token itself, and not as an additional token following
it, and the Sniff does not check for this possibility.

Test script:
---------------
"<?php
//stuff
?>
"

Expected result:
----------------
ERROR: Additional whitespace found at end of file

Actual result:
--------------
No error reported.

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


-- 
Edit this bug report at https://pear.php.net/bugs/bug.php?id=20375&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.