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

Request #12561 Scope detection throws E_NOTICE
Submitted: 2007-12-01 19:11 UTC
From: mapi Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.0.0RC3)
PHP Version: Irrelevant OS:
Roadmaps: 1.0.0    
Subscription  


 [2007-12-01 19:11 UTC] mapi (Manuel Pichler)
Description: ------------ The current implementation of PHP_CodeSniffer throws multiple E_NOTICE errors if the code exceeds the defined line distance between scope identifier and the scope opener token. Except this error the number of look ahead lines should be configurable. For very long class declarations, for example when it implements multiple interfaces. In my opinion should be configurable. Test script: --------------- <?php abstract class CodeSnifferFail extends ArrayObject implements Serializable, Iterator, Countable, OuterIterator, RecursiveIterator { }

Comments

 [2007-12-01 23:28 UTC] squiz (Greg Sherwood)
The 3 line rule is only there to stop tokenizing taking too long as some code blocks do not require braces. Instead of making the look-ahead configurable, I'll change the check to ensure look-aheads continue for some blocks, such as classes/interfaces/functions that must have a scope opener.
 [2007-12-04 23:25 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.