Merge pull request #10481 from frederic34/psr2forloop

psr2 Squiz.ControlStructures.ForEachLoopDeclaration
This commit is contained in:
Laurent Destailleur 2019-02-03 19:11:07 +01:00 committed by GitHub
commit 9f7dfe2921
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
54 changed files with 219 additions and 231 deletions

View File

@ -190,6 +190,9 @@
</rule> </rule>
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" /> <rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen" />
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose" />
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" /> <rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"> <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
<properties> <properties>

View File

@ -722,18 +722,14 @@ class Project extends CommonObject
} }
} }
if (empty($error)) if (empty($error)) {
{
// We remove directory // We remove directory
$projectref = dol_sanitizeFileName($this->ref); $projectref = dol_sanitizeFileName($this->ref);
if ($conf->projet->dir_output) if ($conf->projet->dir_output) {
{
$dir = $conf->projet->dir_output . "/" . $projectref; $dir = $conf->projet->dir_output . "/" . $projectref;
if (file_exists($dir)) if (file_exists($dir)) {
{
$res = @dol_delete_dir_recursive($dir); $res = @dol_delete_dir_recursive($dir);
if (!$res) if (!$res) {
{
$this->errors[] = 'ErrorFailToDeleteDir'; $this->errors[] = 'ErrorFailToDeleteDir';
$error++; $error++;
} }
@ -955,48 +951,37 @@ class Project extends CommonObject
// phpcs:enable // phpcs:enable
global $langs; global $langs;
if ($mode == 0) if ($mode == 0) {
{
return $langs->trans($this->statuts_long[$statut]); return $langs->trans($this->statuts_long[$statut]);
} } elseif ($mode == 1) {
if ($mode == 1)
{
return $langs->trans($this->statuts_short[$statut]); return $langs->trans($this->statuts_short[$statut]);
} } elseif ($mode == 2) {
if ($mode == 2)
{
if ($statut == 0) if ($statut == 0)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0') . ' ' . $langs->trans($this->statuts_short[$statut]); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0') . ' ' . $langs->trans($this->statuts_short[$statut]);
if ($statut == 1) elseif ($statut == 1)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4') . ' ' . $langs->trans($this->statuts_short[$statut]); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4') . ' ' . $langs->trans($this->statuts_short[$statut]);
if ($statut == 2) elseif ($statut == 2)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6') . ' ' . $langs->trans($this->statuts_short[$statut]); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6') . ' ' . $langs->trans($this->statuts_short[$statut]);
} } elseif ($mode == 3) {
if ($mode == 3)
{
if ($statut == 0) if ($statut == 0)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0'); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0');
if ($statut == 1) elseif ($statut == 1)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4'); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4');
if ($statut == 2) elseif ($statut == 2)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6'); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6');
} } elseif ($mode == 4) {
if ($mode == 4)
{
if ($statut == 0) if ($statut == 0)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0') . ' ' . $langs->trans($this->statuts_long[$statut]); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0') . ' ' . $langs->trans($this->statuts_long[$statut]);
if ($statut == 1) elseif ($statut == 1)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4') . ' ' . $langs->trans($this->statuts_long[$statut]); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4') . ' ' . $langs->trans($this->statuts_long[$statut]);
if ($statut == 2) if ($statut == 2)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6') . ' ' . $langs->trans($this->statuts_long[$statut]); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6') . ' ' . $langs->trans($this->statuts_long[$statut]);
} } elseif ($mode == 5) {
if ($mode == 5)
{
if ($statut == 0) if ($statut == 0)
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut0'); return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut0');
if ($statut == 1) elseif ($statut == 1)
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut4'); return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut4');
if ($statut == 2) elseif ($statut == 2)
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut6'); return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut6');
} }
} }