Notice outputDescription:
------------
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:449jsf_imento
jsf_imentohttp://pear.php.net/bugs/16641
PHP_CodeSniffer Bug
Reported by jsf_imento
2009-09-24T15:34:42+00:00
PHP: 5.3.0 OS: OSX Package Version: 1.2.0
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]]>PHP_CodeSniffer Bug
Reported by jsf_imento
2009-09-24T15:34:42+00:00
PHP: 5.3.0 OS: OSX Package Version: 1.2.0
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]]>2009-09-24T15:34:42+00:00
ashnazg [2009-10-29 20:43] http://pear.php.net/bugs/16641#1256849017
Greg,
Today I noticed the notices when running phpcs 1.2.0 against some PHP4 code that uses short tags. When I run phpcs while php.ini is *not* allowing short tags, I get the notices from that File.php file... when I enable short tags, no notices.
Hope that helps...
CRB]]>Greg,
Today I noticed the notices when running phpcs 1.2.0 against some PHP4 code that uses short tags. When I run phpcs while php.ini is *not* allowing short tags, I get the notices from that File.php file... when I enable short tags, no notices.
Hope that helps...
CRB]]>2009-10-29T20:43:37+00:00
squiz [2009-10-11 23:06] http://pear.php.net/bugs/16641#1255302398
<div id="changeset">
<span class="removed">-Status: Feedback</span>
<span class="added">+Status: Closed</span>
</div>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.
I've added the same error checking code from addError into addWarning so you shouldn't get the error any more. If you do happen to find the code causing the problem, I'd love to see it if possible because something is obviously not working 100% somewhere.]]><div id="changeset">
<span class="removed">-Status: Feedback</span>
<span class="added">+Status: Closed</span>
</div>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.
I've added the same error checking code from addError into addWarning so you shouldn't get the error any more. If you do happen to find the code causing the problem, I'd love to see it if possible because something is obviously not working 100% somewhere.]]>2009-10-11T23:06:38+00:00
kukulich [2009-10-07 13:25] http://pear.php.net/bugs/16641#1254921946
It's strange that function addError contains a little different piece of code.
public function addError($error, $stackPtr)
{
// Work out which sniff generated the error.
$parts = explode('_', $this->_activeListener);
if (isset($parts[3]) === true) {
$sniff = $parts[0].'.'.$parts[2].'.'.$parts[3];
} else {
$sniff = 'unknownSniff';
}
...
}
public function addWarning($warning, $stackPtr)
{
// Work out which sniff generated the warning.
$parts = explode('_', $this->_activeListener);
$sniff = $parts[0].'.'.$parts[2].'.'.$parts[3];
...
}]]>It's strange that function addError contains a little different piece of code.
public function addError($error, $stackPtr)
{
// Work out which sniff generated the error.
$parts = explode('_', $this->_activeListener);
if (isset($parts[3]) === true) {
$sniff = $parts[0].'.'.$parts[2].'.'.$parts[3];
} else {
$sniff = 'unknownSniff';
}
...
}
public function addWarning($warning, $stackPtr)
{
// Work out which sniff generated the warning.
$parts = explode('_', $this->_activeListener);
$sniff = $parts[0].'.'.$parts[2].'.'.$parts[3];
...
}]]>2009-10-07T13:25:46+00:00
jsf_imento [2009-09-30 12:48] http://pear.php.net/bugs/16641#1254314935
Well its occurs as part of my CI build so a lot of code goes through, but Ill see if I can dig out the offending code..... it may take a few days thou.]]>Well its occurs as part of my CI build so a lot of code goes through, but Ill see if I can dig out the offending code..... it may take a few days thou.]]>2009-09-30T12:48:55+00:00
squiz [2009-09-30 12:10] http://pear.php.net/bugs/16641#1254312626
Well that is pretty strange. Any chance you can share the code that you are checking? It sounds like there is more of a core problem checking it and suppressing the NOTICE might just be hiding another problem.]]>Well that is pretty strange. Any chance you can share the code that you are checking? It sounds like there is more of a core problem checking it and suppressing the NOTICE might just be hiding another problem.]]>2009-09-30T12:10:26+00:00
jsf_imento [2009-09-30 11:26] http://pear.php.net/bugs/16641#1254309978
Adding this code in addWarning() in File.php:
if(!isset($parts[2])){
echo '$this->_activeListener = '.$this->_activeListener;
}
result in this outout:
$this->_activeListener =]]>Adding this code in addWarning() in File.php:
if(!isset($parts[2])){
echo '$this->_activeListener = '.$this->_activeListener;
}
result in this outout:
$this->_activeListener =]]>2009-09-30T11:26:18+00:00
squiz [2009-09-28 05:46] http://pear.php.net/bugs/16641#1254116804
<div id="changeset">
<span class="removed">-Status: Assigned</span>
<span class="added">+Status: Feedback</span>
</div>]]><div id="changeset">
<span class="removed">-Status: Assigned</span>
<span class="added">+Status: Feedback</span>
</div>]]>2009-09-28T05:46:44+00:00
squiz [2009-09-28 05:46] http://pear.php.net/bugs/16641#1254116792
<div id="changeset">
<span class="removed">-Assigned To:</span>
<span class="added">+Assigned To: squiz</span>
</div>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.]]><div id="changeset">
<span class="removed">-Assigned To:</span>
<span class="added">+Assigned To: squiz</span>
</div>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-28T05:46:32+00:00