Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored January 13, 2011
5  CodeSniffer/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php
@@ -109,6 +109,11 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
109 109
             return;
110 110
         }
111 111
 
  112
+        if ($tokens[$prev]['code'] === T_NEW) {
  113
+            // Object creation, not an inbuilt function.
  114
+            return;
  115
+        }
  116
+
112 117
         if ($tokens[$prev]['code'] === T_OBJECT_OPERATOR) {
113 118
             // Not an inbuilt function.
114 119
             return;
1  CodeSniffer/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc
@@ -31,4 +31,5 @@ if (Function_Exists('myFunction') === TRUE) {
31 31
 
32 32
 function getType() {}
33 33
 
  34
+$obj = new Date();
34 35
 ?>
1  package.xml
@@ -87,6 +87,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
87 87
   - Fixed bug #18145 : Sniffs are not loaded for custom ruleset file
88 88
     -- Thanks to Scott McCammon for the patch
89 89
   - Fixed bug #18152 : While and do-while with AbstractPatternSniff
  90
+  - Fixed bug #18191 : Squiz.PHP.LowercasePHPFunctions does not work with new Date()
90 91
  </notes>
91 92
  <contents>
92 93
   <dir name="/">

0 notes on commit 35efd21

Please sign in to comment.
Something went wrong with that request. Please try again.