FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=16792&edit=1

ID: 16792
Updated by: gsherwood@squiz.net
Reported By: kukulich at kukulich dot cz
Summary: Bug in Generic_Sniffs_PHP_ForbiddenFunctionsSniff
-Status: Open
+Status: Closed
Type: Bug
Package: PHP_CodeSniffer
Package Version: CVS
PHP Version: Irrelevant
-Assigned To:
+Assigned To: squiz
Roadmap Versions:
New Comment:

-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.




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

[2009-11-16 20:48:54] kukulich

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
-----------------------------------------------------------------------------

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

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedNov 17, '09 at 3:17a
activeNov 17, '09 at 3:17a
posts1
users1
websitepear.php.net

1 user in discussion

Gsherwood: 1 post

People

Translate

site design / logo © 2022 Grokbase