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

Bug #12888 extra space indentation = Notice: Uninitialized string offset...
Submitted: 2008-01-12 05:28 UTC
From: fmpwizard Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.0.0)
PHP Version: 5.2.4 OS: Linux Fedora 7
Roadmaps: 1.0.1    
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 : 37 - 32 = ?

 
 [2008-01-12 05:28 UTC] fmpwizard (Diego Medina)
Description: ------------ running: shell>phpcs /var/www/class/newfile.php gives me a notice on file /usr/local/apache/php/lib/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php on line 491 This happens if I add an extra space before the @autor tag It is similar this "bogus" bug http://pear.php.net/bugs/bug.php?id=12477 but as I do not have any include/require on my file, I thought to report it. Other than that, I look forward to using this package more and more. Test script: --------------- Very simple <?php /** * Created on Jan 8, 2008 * * @package Dellcompatibility.php * @author Diego <diego@domaincom> * @version SVN: 37 * * TODO: TODO **/ ?> Expected result: ---------------- to tell me that I have an extra space before @author Actual result: -------------- The result is in two parts: ============ Notice: Uninitialized string offset: 0 in /usr/local/apache/php/lib/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php on line 491 Call Stack: 0.0011 128000 1. {main}() /usr/local/apache/php/bin/phpcs:0 0.0139 949704 2. PHP_CodeSniffer->process() /usr/local/apache/php/bin/phpcs:289 0.0391 2201132 3. PHP_CodeSniffer->processFile() /usr/local/apache/php/lib/php/PHP/CodeSniffer.php:265 0.0462 2259904 4. PHP_CodeSniffer_File->start() /usr/local/apache/php/lib/php/PHP/CodeSniffer.php:549 0.0466 2259904 5. PEAR_Sniffs_Commenting_FileCommentSniff->process() /usr/local/apache/php/lib/php/PHP/CodeSniffer/File.php:479 0.0488 2276848 6. PEAR_Sniffs_Commenting_FileCommentSniff->processTags() /usr/local/apache/php/lib/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:209 0.0490 2279656 7. call_user_func() /usr/local/apache/php/lib/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:379 0.0490 2279856 8. PEAR_Sniffs_Commenting_FileCommentSniff->processPackage() /usr/local/apache/php/lib/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:0 ================ and then, the format of the report is all messed up ============ FOUND 5 ERROR(S) AND 1 WARNING(S) AFFECTING 2 LINE(S) -------------------------------------------------------------------------------- 5 | ERROR | Package name "Dellcompatibility.php @author Diego Medina | | <diego@fmpwizard.com>" is not valid; consider | | "Dellcompatibility.php __@author_Diego_Medina_<diego@fmpwizard.com>" | | instead 10 | WARNING | PHP version not specified 10 | ERROR | Missing @category tag in file comment 10 | ERROR | Missing @author tag in file comment 10 | ERROR | Missing @license tag in file comment 10 | ERROR | Missing @link tag in file comment -------------------------------------------------------------------------------- ========

Comments

 [2008-01-12 08:45 UTC] squiz (Greg Sherwood)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.
 [2008-01-12 08:57 UTC] squiz (Greg Sherwood)
There is no check in phpcs for additional spaces before tags. I will add that in also, just not as part of this specific bug, which was caused by a general comment parsing error.