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

Bug #19772 PSR2_Sniffs_Namespaces_UseDeclarationSniff does not properly recognize last use
Submitted: 2013-01-04 20:28 UTC
From: timwolla Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version SVN)
PHP Version: Irrelevant OS: Linux node42 3.5.0-21-generic #3
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 : 34 - 4 = ?

 
 [2013-01-04 20:28 UTC] timwolla (Tim Düsterhus)
Description: ------------ When there are closure with a use-Token, the last use of the imports is not properly recognized Test script: --------------- <?php namespace bug; use someNS\A; use someNS\B; class Bug { public function __construct() { $b = 1; $a = function () use ($b) { echo $b; }; } } Expected result: ---------------- FILE: ./Test.php -------------------------------------------------------------------------------- FOUND 3 ERROR(S) AFFECTING 3 LINE(S) -------------------------------------------------------------------------------- 5 | ERROR | There must be one blank line after the last USE statement; 0 | | found; -------------------------------------------------------------------------------- Actual result: -------------- <empty output>

Comments

 [2013-01-07 07:09 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Fix committed to github repo: https://github.com/squizlabs/PHP_CodeSniffer/commit/9f191df0d0dd536e464b30b604 5ac304d56e9e2f