Menu

Commit [r118]  Maximize  Restore  History

Issue 35: New Rule : Use of "==" in strpos

tchule@hotmail.com 2012-07-03

changed /trunk/PhpCheckstyle/config/default.cfg.xml
changed /trunk/PhpCheckstyle/src/PHPCheckstyle.php
changed /trunk/PhpCheckstyle/src/styleErrors.inc.php
added /trunk/PhpCheckstyle/test/bad_strictcompare_2.php
/trunk/PhpCheckstyle/config/default.cfg.xml Diff Switch to side-by-side view
--- a/trunk/PhpCheckstyle/config/default.cfg.xml
+++ b/trunk/PhpCheckstyle/config/default.cfg.xml
@@ -415,4 +415,20 @@
     	<deprecated old="$HTTP_SESSION_VARS" new="$_SESSION" version="5.3"/>
     </test>
     
+    <!--  *******************  -->
+    <!--      FindBugs         -->
+    <!--  *******************  --> 
+    
+    <!-- Use only strict comparison with these functions -->
+    <!-- see : http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ -->
+    <test name="strictCompare">
+    	<item value="array_search"/>
+    	<item value="strpos"/>
+    	<item value="stripos"/>
+    	<item value="strrpos"/>
+    	<item value="strripos"/>
+    	<item value="strripos"/>
+    	<item value="mb_strpos"/>
+    </test>
+    
 </phpcheckstyle-configuration>
\ No newline at end of file
/trunk/PhpCheckstyle/src/PHPCheckstyle.php Diff Switch to side-by-side view
Loading...
/trunk/PhpCheckstyle/src/styleErrors.inc.php Diff Switch to side-by-side view
Loading...
/trunk/PhpCheckstyle/test/bad_strictcompare_2.php Diff Switch to side-by-side view
Loading...
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.