]> git.openstreetmap.org Git - nominatim.git/blobdiff - phpcs.xml
check if query is valid unicode string
[nominatim.git] / phpcs.xml
index 6c7ce19efed671a83ebd08353132cda077227773..c8b8a80e55d1d88e775aaedb28e6b5b54d338832 100644 (file)
--- a/phpcs.xml
+++ b/phpcs.xml
   </rule>
 
 
   </rule>
 
 
+  <!-- "A file should declare new symbols (classes, functions, constants, etc.) and cause no
+    other side effects, or it should execute logic with side effects, but should not do both."
+    ... we have too many script and includes to be able to enforce that.
+     -->
+  <rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
+    <severity>0</severity>
+  </rule>
+
+
 
   <!-- **************************************************************
        DOCUMENTATION
        ************************************************************** -->
 
 
   <!-- **************************************************************
        DOCUMENTATION
        ************************************************************** -->
 
-  <rule ref="PEAR.Commenting.FileComment.Missing">
-    <severity>0</severity>
-  </rule>
-  <rule ref="PEAR.Commenting.ClassComment.Missing">
-    <severity>0</severity>
-  </rule>    
   <rule ref="PEAR.Commenting.FunctionComment.Missing">
     <severity>0</severity>
   </rule>
   <rule ref="PEAR.Commenting.FunctionComment.Missing">
     <severity>0</severity>
   </rule>
        COMMENTS
        ************************************************************** -->
 
        COMMENTS
        ************************************************************** -->
 
+  <!-- any comments in the lines before function() are better than forcing
+       a PHPdoc style right now -->
+  <rule ref="PEAR.Commenting.FunctionComment.WrongStyle">
+    <severity>0</severity>
+  </rule>
+
   <!-- We allow comments after statements -->
   <rule ref="Squiz.Commenting.PostStatementComment.Found">
     <severity>0</severity>
   <!-- We allow comments after statements -->
   <rule ref="Squiz.Commenting.PostStatementComment.Found">
     <severity>0</severity>
   <rule ref="Squiz.Commenting.InlineComment.NoSpaceBefore">
     <severity>0</severity>
   </rule>
   <rule ref="Squiz.Commenting.InlineComment.NoSpaceBefore">
     <severity>0</severity>
   </rule>
+  <!-- blank lines after inline comments are fine -->
+  <rule ref="Squiz.Commenting.InlineComment.SpacingAfter">
+    <severity>0</severity>
+  </rule>
 
   <!-- Comments don't have to start uppercase -->
   <rule ref="Squiz.Commenting.InlineComment.NotCapital">
 
   <!-- Comments don't have to start uppercase -->
   <rule ref="Squiz.Commenting.InlineComment.NotCapital">
   <rule ref="Squiz.Commenting.InlineComment.InvalidEndChar">
     <severity>0</severity>
   </rule>
   <rule ref="Squiz.Commenting.InlineComment.InvalidEndChar">
     <severity>0</severity>
   </rule>
-
-  <!-- we don't need '} // functionname()' at end of large blocks -->
-  <rule ref="Squiz.Commenting.ClosingDeclarationComment.Missing">
-    <severity>0</severity>
-  </rule>
-  <!-- .. same for conditions -->
-  <rule ref="Squiz.Commenting.LongConditionClosingComment.Missing">
+  <!-- Empty comments are fine -->
+  <rule ref="Squiz.Commenting.InlineComment.Empty">
     <severity>0</severity>
   </rule>
 
 
 
 
     <severity>0</severity>
   </rule>
 
 
 
 
-
   <!-- **************************************************************
        INDENTATION, SPACING
        ************************************************************** -->
   <!-- **************************************************************
        INDENTATION, SPACING
        ************************************************************** -->
@@ -86,6 +93,9 @@
   <rule ref="Generic.Formatting.MultipleStatementAlignment.NotSame">
     <severity>0</severity>
   </rule>
   <rule ref="Generic.Formatting.MultipleStatementAlignment.NotSame">
     <severity>0</severity>
   </rule>
+  <rule ref="Generic.Formatting.MultipleStatementAlignment.NotSameWarning">
+    <severity>0</severity>
+  </rule>
 
   <!-- Aligned looks nicer, but causes too many warnings currently -->
   <rule ref="Squiz.Arrays.ArrayDeclaration.DoubleArrowNotAligned">
 
   <!-- Aligned looks nicer, but causes too many warnings currently -->
   <rule ref="Squiz.Arrays.ArrayDeclaration.DoubleArrowNotAligned">
   <rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed">
     <severity>0</severity>
   </rule>
   <rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed">
     <severity>0</severity>
   </rule>
-  <rule ref="Generic.ControlStructures.InlineControlStructure.Discouraged">
-    <severity>0</severity>
-  </rule>
-  <rule ref="Squiz.PHP.DisallowInlineIf.Found">
-    <severity>0</severity>
-  </rule>
 
   <!-- We allow "if (a)". No need for "if (a === TRUE)" -->
   <rule ref="Squiz.Operators.ComparisonOperatorUsage.ImplicitTrue">
 
   <!-- We allow "if (a)". No need for "if (a === TRUE)" -->
   <rule ref="Squiz.Operators.ComparisonOperatorUsage.ImplicitTrue">
     <severity>0</severity>
   </rule>
 
     <severity>0</severity>
   </rule>
 
-  <!-- We allow
-              if (a)
-              {
-  -->
-  <rule ref="PEAR.ControlStructures.MultiLineCondition.NewlineBeforeOpenBrace">
-    <severity>0</severity>
-  </rule>
-  <!-- ... same -->
-  <rule ref="Squiz.WhiteSpace.ControlStructureSpacing.NoLineAfterClose">
-    <severity>0</severity>
-  </rule>
-  <!-- ... same for foreach/while etc -->
-  <rule ref="PEAR.ControlStructures.ControlSignature">
-    <severity>0</severity>
-  </rule>
-  <!-- ... same -->
-  <rule ref="Squiz.WhiteSpace.FunctionClosingBraceSpace.SpacingBeforeClose">
-    <severity>0</severity>
-  </rule>
 
 
 </ruleset>
 
 
 </ruleset>