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

Bug #9844 throw new Exception(\n accidently reported as error but it ain't
Submitted: 2007-01-15 15:12 UTC
From: tkli at php dot net Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 0.3.0)
PHP Version: 5.2.0 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2007-01-15 15:12 UTC] tkli at php dot net (Tom Klingenberg)
Description: ------------ codesniffer handles the throw new Exception() as a function call, but it isn't. that lead to reported errors with php code that is valid according to the pear standard. these error should not be reported. <phpcs> 179 | ERROR | Space after opening parenthesis of function call prohibited 181 | ERROR | Space before closing parenthesis of function call prohibited </phpcs> <php> /* validate version parameter */ if (self::_ISBNVersionIs($ver) == false) { throw new ISBN_Exception( 'ISBN Version parameter is not an ISBN Version' ); } </php> check the pear docs here: http://pear.php.net/manual/en/standars.errors.php additional info: this error occured in 0.2.0 as well. Test script: --------------- n/a

Comments

 [2007-01-15 22:35 UTC] squiz at php dot net (Greg Sherwood)
This bug has been fixed in CVS. 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. Added check for "new" keyword before processing. If found, the "function call" is ignored.