Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed bug #18191 : Squiz.PHP.LowercasePHPFunctions does not work with…

… new Date()

git-svn-id: http://svn.php.net/repository/pear/packages/PHP_CodeSniffer/trunk@307455 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
commit 35efd21ee16ebd0fcae09feb209aa30a36906865 1 parent 79a1730
Greg Sherwood gsherwood authored
5 CodeSniffer/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php
View
@@ -109,6 +109,11 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
return;
}
+ if ($tokens[$prev]['code'] === T_NEW) {
+ // Object creation, not an inbuilt function.
+ return;
+ }
+
if ($tokens[$prev]['code'] === T_OBJECT_OPERATOR) {
// Not an inbuilt function.
return;
1  CodeSniffer/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc
View
@@ -31,4 +31,5 @@ if (Function_Exists('myFunction') === TRUE) {
function getType() {}
+$obj = new Date();
?>
1  package.xml
View
@@ -87,6 +87,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Fixed bug #18145 : Sniffs are not loaded for custom ruleset file
-- Thanks to Scott McCammon for the patch
- Fixed bug #18152 : While and do-while with AbstractPatternSniff
+ - Fixed bug #18191 : Squiz.PHP.LowercasePHPFunctions does not work with new Date()
</notes>
<contents>
<dir name="/">
Please sign in to comment.
Something went wrong with that request. Please try again.