Fix phpcs

This commit is contained in:
Laurent Destailleur 2019-05-23 14:25:16 +02:00
parent 5f639f611a
commit e8ba312d2a
8 changed files with 45 additions and 20 deletions

View File

@ -75,10 +75,13 @@
<!-- Warning if action on same line than if --> <!-- Warning if action on same line than if -->
<!-- <!--
<rule ref="Generic.ControlStructures.InlineControlStructure"> <rule ref="Generic.ControlStructures.InlineControlStructure">
<properties> <property name="error" value="false"/> </properties> <properties>
<property name="error" value="false"/>
</properties>
</rule> </rule>
--> -->
<!-- PHP code MUST use only UTF-8 without BOM. --> <!-- PHP code MUST use only UTF-8 without BOM. -->
<rule ref="Generic.Files.ByteOrderMark"/> <rule ref="Generic.Files.ByteOrderMark"/>
@ -97,8 +100,11 @@
</properties> </properties>
</rule> </rule>
<!-- To disallow several statements on same line --> <!-- Disallow several statements on same line -->
<!-- <rule ref="Generic.Formatting.DisallowMultipleStatements" /> --> <!-- We want to allow 'if () { ...small code... }' on same line for better code compacity and readability -->
<rule ref="Generic.Formatting.DisallowMultipleStatements">
<severity>0</severity>
</rule>
<!-- Have 2 chars padding maximum and always show as errors --> <!-- Have 2 chars padding maximum and always show as errors -->
<!-- <!--
@ -112,13 +118,17 @@
<rule ref="Generic.Functions.CallTimePassByReference" /> <rule ref="Generic.Functions.CallTimePassByReference" />
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" /> <rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals"> <rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals"> <rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma"> <!-- We don't want this rule, we want to be able to align params on several similare functions on different lines -->
<!-- Disallow several spaces after comma -->
<!-- We want to allow this because we want to be able to align params on several similare functions on different lines -->
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
@ -152,7 +162,10 @@
<rule ref="Generic.PHP.ForbiddenFunctions" /> <rule ref="Generic.PHP.ForbiddenFunctions" />
<!-- Warning when using @ before functions --> <!-- Warning when using @ before functions -->
<!-- <rule ref="Generic.PHP.NoSilencedErrors" /> --> <!-- We want this. Some features need this -->
<rule ref="Generic.PHP.NoSilencedErrors">
<severity>0</severity>
</rule>
<!-- Say if null, true, false must be uppercase (Rule 2.5 of PSR2 https://www.php-fig.org/psr/psr-2/) --> <!-- Say if null, true, false must be uppercase (Rule 2.5 of PSR2 https://www.php-fig.org/psr/psr-2/) -->
<rule ref="Generic.PHP.LowerCaseConstant" /> <rule ref="Generic.PHP.LowerCaseConstant" />
@ -169,6 +182,7 @@
<!-- Check indent are done with spaces and with correct number --> <!-- Check indent are done with spaces and with correct number -->
<!-- Disabled as this does not support tab --> <!-- Disabled as this does not support tab -->
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> --> <!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
<arg name="tab-width" value="4"/> <arg name="tab-width" value="4"/>
<rule ref="Generic.WhiteSpace.ScopeIndent"> <rule ref="Generic.WhiteSpace.ScopeIndent">
<properties> <properties>
@ -177,6 +191,7 @@
</properties> </properties>
</rule> </rule>
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" /> <rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />
<!-- There MUST NOT be trailing whitespace at the end of non-blank lines. --> <!-- There MUST NOT be trailing whitespace at the end of non-blank lines. -->
@ -317,22 +332,29 @@
<rule ref="PEAR.Commenting.InlineComment" /> <rule ref="PEAR.Commenting.InlineComment" />
<!-- <rule ref="PEAR.ControlStructures.ControlSignature" /> --> <!-- Check position of { after a control structure like if (), while (), etc... -->
<!--
<rule ref="PEAR.ControlStructures.ControlSignature" />
-->
<!-- <rule ref="PEAR.ControlStructures.MultiLineCondition" /> --> <!-- <rule ref="PEAR.ControlStructures.MultiLineCondition" /> -->
<!-- Test if () are removed for includes --> <!-- Test if () are removed for includes -->
<rule ref="PEAR.Files.IncludingFile" /> <rule ref="PEAR.Files.IncludingFile" />
<!-- Disable some error messages that we do not want. --> <!-- Disable some error messages that we do not want. -->
<rule ref="PEAR.Files.IncludingFile.UseInclude"> <rule ref="PEAR.Files.IncludingFile.UseInclude">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<!-- TODO Enable this test. We should use require for include in prior of include when out of if -->
<rule ref="PEAR.Files.IncludingFile.UseIncludeOnce"> <rule ref="PEAR.Files.IncludingFile.UseIncludeOnce">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.Files.IncludingFile.UseRequire"> <rule ref="PEAR.Files.IncludingFile.UseRequire">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<!-- TODO Enable this test. We should use require for include in prior of include when out of if -->
<rule ref="PEAR.Files.IncludingFile.UseRequireOnce"> <rule ref="PEAR.Files.IncludingFile.UseRequireOnce">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
@ -341,12 +363,15 @@
<rule ref="PEAR.Functions.FunctionCallSignature" /> <rule ref="PEAR.Functions.FunctionCallSignature" />
<!-- TODO Enable this test. -->
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine"> <rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<!-- TODO Enable this test. -->
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket"> <rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine"> <rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine">
<severity>0</severity> <severity>0</severity>
</rule> </rule>

View File

@ -596,7 +596,7 @@ class Adherent extends CommonObject
{ {
while ($obj=$this->db->fetch_object($resql2)) while ($obj=$this->db->fetch_object($resql2))
{ {
$this->type=$obj->label; $this->type=$obj->label;
} }
} }
} }

View File

@ -411,7 +411,7 @@ class AdherentType extends CommonObject
} }
} }
/** /**
* Return translated label by the nature of a adherent (physical or moral) * Return translated label by the nature of a adherent (physical or moral)
* *
* @param string $morphy Nature of the adherent (physical or moral) * @param string $morphy Nature of the adherent (physical or moral)

View File

@ -43,13 +43,13 @@ if (empty($sortorder)) { $sortorder="ASC"; }
if (empty($sortfield)) { $sortfield="d.login"; } if (empty($sortfield)) { $sortfield="d.login"; }
if (! isset($statut)) if (! isset($statut))
{ {
$statut = 1 ; $statut = 1 ;
} }
if (! isset($cotis)) if (! isset($cotis))
{ {
// by default, members must be up to date of subscription // by default, members must be up to date of subscription
$cotis=1; $cotis=1;
} }

View File

@ -235,7 +235,7 @@ else
print '<br>'; print '<br>';
print '<a href="'.$_SERVER["PHP_SELF"].'?mode=memberbytown">'.$langs->trans("MembersStatisticsByTown").'</a><br>'; print '<a href="'.$_SERVER["PHP_SELF"].'?mode=memberbytown">'.$langs->trans("MembersStatisticsByTown").'</a><br>';
print '<br>';//+ print '<br>';//+
print '<a href="'.$_SERVER["PHP_SELF"].'?mode=memberbyregion">'.$langs->trans("MembersStatisticsByRegion").'</a><br>';//+ print '<a href="'.$_SERVER["PHP_SELF"].'?mode=memberbyregion">'.$langs->trans("MembersStatisticsByRegion").'</a><br>';//+
} }
print '<br>'; print '<br>';
} }

View File

@ -306,7 +306,7 @@ if (! empty($arrayfields['d.fk_type']['checked']))
{ {
print '<td class="liste_titre left">'; print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="search_type" value="'.dol_escape_htmltag($search_type).'" size="7">'; print '<input class="flat" type="text" name="search_type" value="'.dol_escape_htmltag($search_type).'" size="7">';
print'</td>'; print'</td>';
} }
if (! empty($arrayfields['d.lastname']['checked'])) if (! empty($arrayfields['d.lastname']['checked']))

View File

@ -47,10 +47,10 @@ foreach($linkedObjectBlock as $key => $objectlink)
<td class="center"></td> <td class="center"></td>
<td class="center"><?php echo dol_print_date($objectlink->dateh, 'day'); ?></td> <td class="center"><?php echo dol_print_date($objectlink->dateh, 'day'); ?></td>
<td class="right"><?php <td class="right"><?php
if ($user->rights->adherent->lire) { if ($user->rights->adherent->lire) {
$total = $total + $objectlink->amount; $total = $total + $objectlink->amount;
echo price($objectlink->amount); echo price($objectlink->amount);
} ?></td> } ?></td>
<td class="right"></td> <td class="right"></td>
<td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td> <td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
</tr> </tr>

View File

@ -281,9 +281,9 @@ if (! $rowid && $action != 'create' && $action != 'edit')
print '</td>'; print '</td>';
print '<td>'.dol_escape_htmltag($objp->label).'</td>'; print '<td>'.dol_escape_htmltag($objp->label).'</td>';
print '<td class="center">'; print '<td class="center">';
if ($objp->morphy == 'phy') { print $langs->trans("Physical"); } if ($objp->morphy == 'phy') { print $langs->trans("Physical"); }
elseif ($objp->morphy == 'mor') { print $langs->trans("Moral"); } elseif ($objp->morphy == 'mor') { print $langs->trans("Moral"); }
else print $langs->trans("Physical & Morale"); else print $langs->trans("Physical & Morale");
print '</td>'; print '</td>';
print '<td class="center">'.yn($objp->subscription).'</td>'; print '<td class="center">'.yn($objp->subscription).'</td>';
print '<td class="center">'.yn($objp->vote).'</td>'; print '<td class="center">'.yn($objp->vote).'</td>';