From 1df6389b7edf2a28fd8d71f1f6551d30f4cbfbe5 Mon Sep 17 00:00:00 2001
From: "florian.azizian" <florian.azizian@maarch.org>
Date: Fri, 6 Mar 2020 15:43:10 +0100
Subject: [PATCH] FIX Only PSR PHP

---
 .../folder/controllers/FolderController.php   |  2 +-
 .../controllers/FolderPrintController.php     | 39 +++++++++----------
 .../controllers/SummarySheetController.php    |  6 +--
 3 files changed, 22 insertions(+), 25 deletions(-)

diff --git a/src/app/folder/controllers/FolderController.php b/src/app/folder/controllers/FolderController.php
index bb48d709991..0b12c1b5191 100755
--- a/src/app/folder/controllers/FolderController.php
+++ b/src/app/folder/controllers/FolderController.php
@@ -317,7 +317,7 @@ class FolderController
         foreach ($data['sharing']['entities'] as $item) {
             if (isset($item['entity_id'])) {
                 $entities[] = $item;
-            } else if (isset($item['keyword'])) {
+            } elseif (isset($item['keyword'])) {
                 $keywords[] = $item;
             }
         }
diff --git a/src/app/resource/controllers/FolderPrintController.php b/src/app/resource/controllers/FolderPrintController.php
index cd5f359efdb..33e1096fa3b 100644
--- a/src/app/resource/controllers/FolderPrintController.php
+++ b/src/app/resource/controllers/FolderPrintController.php
@@ -14,7 +14,6 @@
 
 namespace Resource\controllers;
 
-
 use AcknowledgementReceipt\models\AcknowledgementReceiptModel;
 use Attachment\models\AttachmentModel;
 use Contact\controllers\ContactController;
@@ -87,7 +86,7 @@ class FolderPrintController
         $unitsSummarySheet = [];
         if (!empty($body['summarySheet'])) {
             $unitsSummarySheet = $body['summarySheet'];
-        } else if (count($body['resources']) > 1) {
+        } elseif (count($body['resources']) > 1) {
             $unitsSummarySheet = $defaultUnits;
         }
 
@@ -546,19 +545,19 @@ class FolderPrintController
 
         $pdf->SetFont('', '', 10);
         $pdf->MultiCell($width, 30, '<b>' . _CREATED_BY . '</b>', 1, 'L', false, 0, '', '', true, 0, true);
-        $pdf->MultiCell($width, 30, $creator['firstname'] . ' ' . $creator['lastname'] , 1, 'L', false, 1, '', '', true, 0, true);
+        $pdf->MultiCell($width, 30, $creator['firstname'] . ' ' . $creator['lastname'], 1, 'L', false, 1, '', '', true, 0, true);
 
         $pdf->MultiCell($width, 30, '<b>' . _CREATED . '</b>', 1, 'L', false, 0, '', '', true, 0, true);
-        $pdf->MultiCell($width, 30, $creationDate , 1, 'L', false, 1, '', '', true, 0, true);
+        $pdf->MultiCell($width, 30, $creationDate, 1, 'L', false, 1, '', '', true, 0, true);
 
         $pdf->MultiCell($width, 30, '<b>' . _SENT_DATE . '</b>', 1, 'L', false, 0, '', '', true, 0, true);
         $pdf->MultiCell($width, 30, $sendDate, 1, 'L', false, 1, '', '', true, 0, true);
 
         $pdf->MultiCell($width, 30, '<b>' . _FORMAT . '</b>', 1, 'L', false, 0, '', '', true, 0, true);
-        $pdf->MultiCell($width, 30, $acknowledgementReceipt['format'] , 1, 'L', false, 1, '', '', true, 0, true);
+        $pdf->MultiCell($width, 30, $acknowledgementReceipt['format'], 1, 'L', false, 1, '', '', true, 0, true);
 
         $pdf->MultiCell($width, 30, '<b>' . _SENT_TO . '</b>', 1, 'L', false, 0, '', '', true, 0, true);
-        $pdf->MultiCell($width, 30, $displayContact , 1, 'L', false, 1, '', '', true, 0, true);
+        $pdf->MultiCell($width, 30, $displayContact, 1, 'L', false, 1, '', '', true, 0, true);
 
 
         $tmpDir = CoreConfigModel::getTmpPath();
@@ -602,7 +601,7 @@ class FolderPrintController
 
         if ($attachment['recipient_type'] == 'user') {
             $displayContact = UserModel::getLabelledUserById(['id' => $attachment['recipient_id']]);
-        } else if ($attachment['recipient_type'] == 'contact') {
+        } elseif ($attachment['recipient_type'] == 'contact') {
             $contact = ContactModel::getById([
                 'select' => ['id', 'firstname', 'lastname', 'email', 'address_number', 'address_street', 'address_postcode',
                              'address_town', 'address_country', 'company'],
@@ -642,28 +641,28 @@ class FolderPrintController
         $pdf->SetFont('', '', 10);
 
         $pdf->MultiCell($width, 30, '<b>' . _CHRONO_NUMBER_MASTER . '</b>', 1, 'L', false, 0, '', '', true, 0, true);
-        $pdf->MultiCell($width, 30, $chronoResource , 1, 'L', false, 1, '', '', true, 0, true);
+        $pdf->MultiCell($width, 30, $chronoResource, 1, 'L', false, 1, '', '', true, 0, true);
 
         $pdf->MultiCell($width, 30, '<b>' . _SUBJECT . '</b>', 1, 'L', false, 0, '', '', true, 0, true);
         $pdf->MultiCell($width, 30, $attachment['title'], 1, 'L', false, 1, '', '', true, 0, true);
 
         $pdf->MultiCell($width, 30, '<b>' . _CREATED_BY . '</b>', 1, 'L', false, 0, '', '', true, 0, true);
-        $pdf->MultiCell($width, 30, $creator['firstname'] . ' ' . $creator['lastname'] , 1, 'L', false, 1, '', '', true, 0, true);
+        $pdf->MultiCell($width, 30, $creator['firstname'] . ' ' . $creator['lastname'], 1, 'L', false, 1, '', '', true, 0, true);
 
         $pdf->MultiCell($width, 30, '<b>' . _CREATED . '</b>', 1, 'L', false, 0, '', '', true, 0, true);
-        $pdf->MultiCell($width, 30, $creationDate , 1, 'L', false, 1, '', '', true, 0, true);
+        $pdf->MultiCell($width, 30, $creationDate, 1, 'L', false, 1, '', '', true, 0, true);
 
         $pdf->MultiCell($width, 30, '<b>' . _FORMAT . '</b>', 1, 'L', false, 0, '', '', true, 0, true);
-        $pdf->MultiCell($width, 30, $attachment['format'] , 1, 'L', false, 1, '', '', true, 0, true);
+        $pdf->MultiCell($width, 30, $attachment['format'], 1, 'L', false, 1, '', '', true, 0, true);
 
         $pdf->MultiCell($width, 30, '<b>' . _STATUS . '</b>', 1, 'L', false, 0, '', '', true, 0, true);
-        $pdf->MultiCell($width, 30, $status , 1, 'L', false, 1, '', '', true, 0, true);
+        $pdf->MultiCell($width, 30, $status, 1, 'L', false, 1, '', '', true, 0, true);
 
         $pdf->MultiCell($width, 30, '<b>' . _DOCTYPE . '</b>', 1, 'L', false, 0, '', '', true, 0, true);
-        $pdf->MultiCell($width, 30, $attachmentType , 1, 'L', false, 1, '', '', true, 0, true);
+        $pdf->MultiCell($width, 30, $attachmentType, 1, 'L', false, 1, '', '', true, 0, true);
 
         $pdf->MultiCell($width, 30, '<b>' . _CONTACT . '</b>', 1, 'L', false, 0, '', '', true, 0, true);
-        $pdf->MultiCell($width, 30, $displayContact , 1, 'L', false, 1, '', '', true, 0, true);
+        $pdf->MultiCell($width, 30, $displayContact, 1, 'L', false, 1, '', '', true, 0, true);
 
 
         $tmpDir = CoreConfigModel::getTmpPath();
@@ -707,9 +706,9 @@ class FolderPrintController
 
         if ($email['status'] == 'SENT') {
             $status = _EMAIL_SENT;
-        } else if ($email['status'] == 'DRAFT') {
+        } elseif ($email['status'] == 'DRAFT') {
             $status = _EMAIL_DRAFT;
-        } else if ($email['status'] == 'WAITING') {
+        } elseif ($email['status'] == 'WAITING') {
             $status = _EMAIL_SENDING;
         } else {
             $status = _EMAIL_ERROR_SENT;
@@ -740,16 +739,16 @@ class FolderPrintController
         $pdf->MultiCell($widthThreeQuarter, 30, $recipients, 1, 'L', false, 1, '', '', true, 0, true);
 
         $pdf->MultiCell($widthQuarter, 30, '<b>' . _TO_CC . '</b>', 1, 'L', false, 0, '', '', true, 0, true);
-        $pdf->MultiCell($widthThreeQuarter, 30, $recipientsCopy , 1, 'L', false, 1, '', '', true, 0, true);
+        $pdf->MultiCell($widthThreeQuarter, 30, $recipientsCopy, 1, 'L', false, 1, '', '', true, 0, true);
 
         $pdf->MultiCell($widthQuarter, 30, '<b>' . _TO_CCI . '</b>', 1, 'L', false, 0, '', '', true, 0, true);
-        $pdf->MultiCell($widthThreeQuarter, 30, $recipientsCopyHidden , 1, 'L', false, 1, '', '', true, 0, true);
+        $pdf->MultiCell($widthThreeQuarter, 30, $recipientsCopyHidden, 1, 'L', false, 1, '', '', true, 0, true);
 
         $pdf->MultiCell($widthQuarter, 30, '<b>' . _SUBJECT . '</b>', 1, 'L', false, 0, '', '', true, 0, true);
-        $pdf->MultiCell($widthThreeQuarter, 30, $email['object'] , 1, 'L', false, 1, '', '', true, 0, true);
+        $pdf->MultiCell($widthThreeQuarter, 30, $email['object'], 1, 'L', false, 1, '', '', true, 0, true);
 
         $pdf->MultiCell($widthQuarter, 30, '<b>' . _STATUS . '</b>', 1, 'L', false, 0, '', '', true, 0, true);
-        $pdf->MultiCell($widthThreeQuarter, 30, $status , 1, 'L', false, 1, '', '', true, 0, true);
+        $pdf->MultiCell($widthThreeQuarter, 30, $status, 1, 'L', false, 1, '', '', true, 0, true);
 
         $pdf->SetY($pdf->GetY() + 5);
 
diff --git a/src/app/resource/controllers/SummarySheetController.php b/src/app/resource/controllers/SummarySheetController.php
index 7a4432360ae..e4a8d02542c 100755
--- a/src/app/resource/controllers/SummarySheetController.php
+++ b/src/app/resource/controllers/SummarySheetController.php
@@ -512,7 +512,6 @@ class SummarySheetController
                         $pdf->MultiCell($widthNotes, 30, $label . " : {$value}", 1, 'L', false, $nextLine, '', '', true, 0, true);
                     }
                 }
-
             } elseif ($unit['unit'] == 'senderRecipientInformations') {
                 $senders = null;
                 if (in_array('senders', $fieldsIdentifier)) {
@@ -573,11 +572,11 @@ class SummarySheetController
                     $pdf->Cell($widthMultiCell, 15, _SENDERS, 1, 0, 'C', false);
                     $pdf->Cell($widthCell, 15, '', 0, 0, 'C', false);
                     $pdf->Cell($widthMultiCell, 15, _RECIPIENTS, 1, 1, 'C', false);
-                } else if ($senders !== null && $recipients === null) {
+                } elseif ($senders !== null && $recipients === null) {
                     $correspondents = $senders;
 
                     $pdf->Cell($widthMultiCell, 15, _SENDERS, 1, 1, 'C', false);
-                } else if ($senders === null && $recipients !== null) {
+                } elseif ($senders === null && $recipients !== null) {
                     $correspondents = $recipients;
 
                     $pdf->Cell($widthMultiCell, 15, _RECIPIENTS, 1, 1, 'C', false);
@@ -611,7 +610,6 @@ class SummarySheetController
                         $pdf->MultiCell($widthCell, 40, '', 0, 'L', false, 0, '', '', true, 0, true);
                     }
                 }
-
             } elseif ($unit['unit'] == 'diffusionList') {
                 $assignee    = '';
                 $destination = '';
-- 
GitLab