remove rule exception

This commit is contained in:
Frédéric FRANCE 2021-03-01 11:26:00 +01:00
parent 1247ca9e02
commit 82aea0be9a
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
2 changed files with 6 additions and 5 deletions

View File

@ -104,9 +104,9 @@
</rule> </rule>
--> -->
<!-- We want to allow 'if () { ...small code... }' on same line for better code compacity and readability --> <!-- We want to allow 'if () { ...small code... }' on same line for better code compacity and readability -->
<rule ref="Generic.Formatting.DisallowMultipleStatements"> <!-- <rule ref="Generic.Formatting.DisallowMultipleStatements">
<severity>0</severity> <severity>0</severity>
</rule> </rule> -->
<!-- Check assignement have the = align on each line. Have 20 chars padding maximum and always show as errors --> <!-- Check assignement have the = align on each line. Have 20 chars padding maximum and always show as errors -->

View File

@ -16,11 +16,12 @@ $object->bbb = 'bbb';
$object->thirdparty = new stdClass(); $object->thirdparty = new stdClass();
$tmp = new Societe($db); $tmp = new Societe($db);
$tmp->name = 'MyBigCompany'; $tmp->name = 'MyBigCompany';
foreach ($tmp as $key=>$value) foreach ($tmp as $key => $value) {
{
if (!in_array($key, array( if (!in_array($key, array(
'name', 'name_alias', 'ref_ext', 'address', 'zip', 'town', 'state_code', 'country_code' 'name', 'name_alias', 'ref_ext', 'address', 'zip', 'town', 'state_code', 'country_code'
))) continue; // Discard if not into a dedicated list ))) {
continue; // Discard if not into a dedicated list
}
if (!is_object($value)) $object->thirdparty->{$key} = $value; if (!is_object($value)) $object->thirdparty->{$key} = $value;
} }