Bug #16641 [Asn->Fbk]: Notice output
| From: | gsherwood at squiz dot net | Date: | Mon, 28 Sep 2009 05:46:44 +0000 |
| Subject: | Bug #16641 [Asn->Fbk]: Notice output | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-1751@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=16641&edit=1
ID: 16641
Updated by: gsherwood@squiz.net
Reported By: jsf at imento dot dk
Summary: Notice output
-Status: Assigned
+Status: Feedback
Type: Bug
Package: PHP_CodeSniffer
Operating System: OSX
Package Version: 1.2.0
PHP Version: 5.3.0
Assigned To: squiz
Roadmap Versions:
New Comment:
-Status: Assigned
+Status: Feedback
Previous Comments:
------------------------------------------------------------------------
[2009-09-28 06:46:32] squiz
-Assigned To:
+Assigned To: squiz
Are you able to tell me what the value of $this->_activeListener was
when you got this problem? All PEAR sniffs should be named correctly and
not have any problems.
------------------------------------------------------------------------
[2009-09-24 16:34:42] jsf_imento
Description:
------------
When running phpcs on a standard osx macports php/pear installation I
get a Notice error in my output. I fixed it by adding to lines, but
maybe
its a deeper problem.
public function addWarning($warning, $stackPtr)
{
// Work out which sniff generated the warning.
$parts = explode('_', $this->_activeListener);
isset($parts[2]) ? $parts[2] : $parts[2] = ''; //Added by
jsf_imento
isset($parts[3]) ? $parts[3] : $parts[3] = ''; //Added by
jsf_imento
$sniff = $parts[0].'.'.$parts[2].'.'.$parts[3];
Test script:
---------------
phpcs --report=checkstyle --standard=PEAR --extensions=php ./
Actual result:
--------------
Notice: Undefined offset: 2 in
/opt/local/lib/php/PHP/CodeSniffer/File.php on line 629
Stack trace:
1. {main}() /opt/local/bin/phpcs:0
2. PHP_CodeSniffer_CLI->process() /opt/local/bin/phpcs:30
3. PHP_CodeSniffer->process()
/opt/local/lib/php/PHP/CodeSniffer/CLI.php:389
4. PHP_CodeSniffer->processFiles()
/opt/local/lib/php/PHP/CodeSniffer.php:341
5. PHP_CodeSniffer->processFile()
/opt/local/lib/php/PHP/CodeSniffer.php:690
6. PHP_CodeSniffer_File->start()
/opt/local/lib/php/PHP/CodeSniffer.php:762
7. PHP_CodeSniffer_File->addWarning()
/opt/local/lib/php/PHP/CodeSniffer/File.php:449
Notice: Undefined offset: 3 in
/opt/local/lib/php/PHP/CodeSniffer/File.php on line 629
Stack trace:
1. {main}() /opt/local/bin/phpcs:0
2. PHP_CodeSniffer_CLI->process() /opt/local/bin/phpcs:30
3. PHP_CodeSniffer->process()
/opt/local/lib/php/PHP/CodeSniffer/CLI.php:389
4. PHP_CodeSniffer->processFiles()
/opt/local/lib/php/PHP/CodeSniffer.php:341
5. PHP_CodeSniffer->processFile()
/opt/local/lib/php/PHP/CodeSniffer.php:690
6. PHP_CodeSniffer_File->start()
/opt/local/lib/php/PHP/CodeSniffer.php:762
7. PHP_CodeSniffer_File->addWarning()
/opt/local/lib/php/PHP/CodeSniffer/File.php:449
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=16641&edit=1