Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.7.2

Bug #19913 Running phpcs in interactive mode causes warnings
Submitted: 2013-04-26 13:50 UTC
From: gemineye Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.4.5)
PHP Version: 5.4.11 OS: Debian
Roadmaps: (Not assigned)    
Subscription  


 [2013-04-26 13:50 UTC] gemineye (Harald Franndorfer)
Description: ------------ After running 'phpcs -a' and getting first error try pressing ENTER to recheck: Notice: Undefined variable: code in /usr/local/zend/share/pear/PHP/CodeSniffer.php on line 1028 Warning: get_class_vars() expects parameter 1 to be string, object given in /usr/local/zend/share/pear/PHP/CodeSniffer.php on line 1035 Warning: Illegal offset type in /usr/local/zend/share/pear/PHP/CodeSniffer.php on line 1040 Warning: Illegal offset type in /usr/local/zend/share/pear/PHP/CodeSniffer.php on line 1060 Expected result: ---------------- I expect to see the error list again. Actual result: -------------- Notice: Undefined variable: code in /usr/local/zend/share/pear/PHP/CodeSniffer.php on line 1028 Warning: get_class_vars() expects parameter 1 to be string, object given in /usr/local/zend/share/pear/PHP/CodeSniffer.php on line 1035 Warning: Illegal offset type in /usr/local/zend/share/pear/PHP/CodeSniffer.php on line 1040 Warning: Illegal offset type in /usr/local/zend/share/pear/PHP/CodeSniffer.php on line 1060

Comments

 [2013-04-26 13:55 UTC] gemineye (Harald Franndorfer)
Temp fix around line 1020 (CodeSniffer.php) foreach ($this->listeners as $listenerClass) { //FIX LINES if(is_object($listenerClass)) { $listenerClass = get_class($listenerClass); } // Work out the internal code for this sniff. Detect usage of namespace // separators instead of underscores to support PHP namespaces. if (strstr($listenerClass, '\\') === false) { $parts = explode('_', $listenerClass); } else { $parts = explode('\\', $listenerClass); }
 [2013-05-06 13:25 UTC] squiz (Greg Sherwood)
-Assigned To: +Assigned To: squiz
I can confirm this. I fixed it in the 1.5 RC releases but I obviously forget to check it in the 1.4 stables because the code is so different. Thanks for the suggested fix too. I'll check it out.
 [2013-05-06 13:33 UTC] squiz (Greg Sherwood)
-Status: Assigned +Status: Closed
Fixed in github repo: https://github.com/squizlabs/PHP_CodeSniffer/commit/3711fdae4cd5c782725a3e5a40 29cabc467b1f95