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

Bug #18191 Squiz.PHP.LowercasePHPFunctions does not work with "new Date()"
Submitted: 2011-01-13 15:09 UTC
From: buchi Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.3.0RC1)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2011-01-13 15:09 UTC] buchi (Gerald Buchgraber)
Description: ------------ Squiz.PHP.LowercasePHPFunctions denotes an error when instantiating the PEAR class Date: "new Date()" Error message: Calls to inbuilt PHP functions must be lowercase; expected "date" but found "Date" This is wrong becuse this is no function call of a built-in PHP function.

Comments

 [2011-01-14 04:23 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.
 [2011-11-16 00:09 UTC] fmazerolle (Francois Mazerolle)
I've copied the file from the GIT repository, and replaced the file ( https://github.com/pear/PHP_CodeSniffer/blob/master/CodeSniffer/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php ) of my current installation, and I still have the issue. Also, I see nothing in the code that check if an object exist, check if the "function" is preceeded by a new tags, or an exclude list. Are you sure it's fixed, what's the patch ?
 [2011-11-21 11:14 UTC] squiz (Greg Sherwood)
-Status: Closed +Status: Feedback
The commit is here: https://github.com/squizlabs/PHP_CodeSniffer/commit/35efd21ee16ebd0fcae09feb20 9aa30a36906865 That commit included a unit test with sample code to ensure no error was being thrown when using a NEW keyword because class names should be ignored. If you have new sample code that fails with the latest PHP_CodeSniffer version, please let me know.
 [2011-12-01 10:09 UTC] squiz (Greg Sherwood)
-Status: Feedback +Status: Closed