Edit report at https://pear.php.net/bugs/bug.php?id=20029&edit=1
ID: 20029
Comment by: [email protected]
Reported By: [email protected]
Summary: ForbiddenFunction sniff incorrectly recognizes
methods in "use" clauses
Status: Open
Type: Bug
Package: PHP_CodeSniffer
Operating System: Debian GNU/Linux 7 (wheezy)
Package Version: 1.4.6
PHP Version: Irrelevant
Roadmap Versions:
New Comment:
Working on a patch today.
Previous Comments:
------------------------------------------------------------------------
[2013-08-05 20:10:38] luke_stoysnet
Description:
------------
ForbiddenFunction sniff recognizes method renames in use clause
as if they were functions.
Test script:
---------------
<?
trait DelProvider {
public function delete() {
//irrelevant
}
}
class MethodIsNotFunctionTest {
use DelProvider {
delete as protected unsetter;
}
}
Actual result:
--------------
The use of function delete() is forbidden; use unset() instead
------------------------------------------------------------------------