Bug #18026 [Opn]: CodeSniffer/File.php have mistake
| From: | eugenechurmanov at soft-rose dot com | Date: | Wed, 03 Nov 2010 13:54:11 +0000 |
| Subject: | Bug #18026 [Opn]: CodeSniffer/File.php have mistake | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-5022@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=18026&edit=1
ID: 18026
Updated by: eugenechurmanov@soft-rose.com
Reported By: eugenechurmanov at soft-rose dot com
Summary: CodeSniffer/File.php have mistake
Status: Open
Type: Bug
Package: PHP_CodeSniffer
-Operating System: Ubuntu 9.04
+Operating System: Ubuntu 9.10
Package Version: 1.3.0RC1
PHP Version: 5.3.3
Roadmap Versions:
New Comment:
-Operating System: Ubuntu 9.04
+Operating System: Ubuntu 9.10
Previous Comments:
------------------------------------------------------------------------
[2010-11-03 13:53:13] ghostvs
Description:
------------
Hi, I'm find mistake int CodeSniffer source.
CodeSniffer/File.php on lines 2223, 2239 and 2243 try use undefined
property PHP_CodeSniffer_File::$tokens must be used
PHP_CodeSniffer_File::$_tokens
Test script:
---------------
<?php
class MyStandard_Sniffs_Files_SomeSniff implements
PHP_CodeSniffer_Sniff
{
public function register()
{
return array(T_CLASS);
}//end register()
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$phpcsFile->getClassProperties($stackPtr);
}//end process()
}//end class
Expected result:
----------------
PHP Notice: Undefined property: PHP_CodeSniffer_File::$tokens in
/usr/local/zend/share/pear/PHP/CodeSniffer/File.php on line 2223
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=18026&edit=1