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

Bug #16792 Bug in Generic_Sniffs_PHP_ForbiddenFunctionsSniff
Submitted: 2009-11-17 01:48 UTC
From: kukulich Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version CVS)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2009-11-17 01:48 UTC] kukulich (Jaroslav HanslĂ­k)
Description: ------------ False positives for class constant. Add T_CONST on line 82 in Generic_Sniffs_PHP_ForbiddenFunctionsSniff. if (in_array($tokens[$prevToken]['code'], array(T_DOUBLE_COLON, T_OBJECT_OPERATOR, T_FUNCTION, T_CONST)) === true) { Test script: --------------- <?php class Test { const DELETE = 'delete'; } ?> Expected result: ---------------- No error. Actual result: -------------- ----------------------------------------------------------------------------- FOUND 1 ERROR(S) AND 0 WARNING(S) AFFECTING 1 LINE(S) ----------------------------------------------------------------------------- 5 | ERROR | The use of function delete() is forbidden; use unset() instead -----------------------------------------------------------------------------

Comments

 [2009-11-17 09:17 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
This bug has been fixed in SVN. 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.