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

Bug #17096 Notice: Undefined index: scope_condition in ScopeClosingBraceSniff.php
Submitted: 2010-02-13 21:38 UTC
From: elfe Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.2.2)
PHP Version: 5.2.5 OS: Linux
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 2 + 39 = ?

 
 [2010-02-13 21:38 UTC] elfe (Karsten Elfenbein)
Description: ------------ Codesniffer (phpcs) produces a notice when encountering the attached code related to bug 17013 Test script: --------------- <?php switch($i) { case 1: {} } ?> Expected result: ---------------- no notice would be expected Actual result: -------------- Notice: Undefined index: scope_condition in /usr/share/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php on line 72 Call Stack: 0.0007 96336 1. {main}() /usr/bin/phpcs:0 0.0170 1604080 2. PHP_CodeSniffer_CLI->process($values = ???) /usr/bin/phpcs:30 0.0180 1611544 3. PHP_CodeSniffer->process($files = array (0 => '/bugged.php'), $standard = 'PEAR', $sniffs = array (), $local = FALSE) /usr/share/php/PHP/CodeSniffer/CLI.php:423 0.0675 3778200 4. PHP_CodeSniffer->processFile($file = '/bugged.php', $contents = ???) /usr/share/php/PHP/CodeSniffer.php:376 0.0677 3779120 5. PHP_CodeSniffer->_processFile($file = '/bugged.php', $contents = NULL) /usr/share/php/PHP/CodeSniffer.php:815 0.0678 3781512 6. PHP_CodeSniffer_File->start($contents = NULL) /usr/share/php/PHP/CodeSniffer.php:900 0.0769 3961288 7. PEAR_Sniffs_WhiteSpace_ScopeClosingBraceSniff->process($phpcsFile = class PHP_CodeSniffer_File { private $_file = '/bugged.php'; public $eolChar = '\n'; public $tokenizer = class PHP_CodeSniffer_Tokenizers_PHP { ... }; public $tokenizerType = 'PHP'; public $numTokens = 21; private $_tokens = array (...); private $_errors = array (...); private $_warnings = array (...); private $_ignoredLines = array (...); private $_errorCount = 1; private $_warningCount = 0; private $_listeners = array (...); private $_activeListener = 'PEAR_Sniffs_WhiteSpace_ScopeClosingBraceSniff'; protected $tokenizers = array (...) }, $stackPtr = 9) /usr/share/php/PHP/CodeSniffer/File.php:431

Comments

 [2010-02-15 08:11 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
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.