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

Bug #19944 docblock squiz sniff "return void" trips over return in lambda function
Submitted: 2013-05-09 14:55 UTC
From: waldvogel Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version Unknown)
PHP Version: 5.4.4 OS: Debian Sid
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 : 48 + 23 = ?

 
 [2013-05-09 14:55 UTC] waldvogel (wald vogel)
Description: ------------ if I have a method that contains a lambda function like this: function ($e) { return new Event($e); }, this check: https://github.com/squizlabs/PHP_CodeSniffer/blob/master/Co deSniffer/Standards/Squiz/Sniffs/Commenting/FunctionComm entSniff.php#L420 thinks that this is the return statement of the method itself and reports an error for the docblock: * @return void "Function return type is void, but function contains return statement" the method doesn't really contain a return statement though. we're using dev-master via composer, so the github master I suppose.

Comments

 [2013-05-21 12:07 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Fixed in github repo: https://github.com/squizlabs/PHP_CodeSniffer/commit/b63ca2ea9b448d26269ab3e8b 554cd7a9276d06f