From 974148550b7ec074179e9e07c6e88959436d52cc Mon Sep 17 00:00:00 2001
From: Antonin <zepcome@gmail.com>
Date: Mon, 26 Oct 2015 16:28:59 +0100
Subject: [PATCH] Refactoring for better reading

---
 app/classes/Framadate/Services/NotificationService.php | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/app/classes/Framadate/Services/NotificationService.php b/app/classes/Framadate/Services/NotificationService.php
index 7944c7f6..f1f181cb 100644
--- a/app/classes/Framadate/Services/NotificationService.php
+++ b/app/classes/Framadate/Services/NotificationService.php
@@ -36,31 +36,33 @@ class NotificationService {
 
         if ($poll->receiveNewVotes) {
 
-            if (self::isParticipation($type))
+            if (self::isParticipation($type)) {
                 $translationString = 'Poll\'s participation: %s';
-            else
+            } else {
                 $translationString = 'Notification of poll: %s';
+            }
 
             $subject = '[' . NOMAPPLICATION . '] ' . __f('Mail', $translationString, $poll->title);
 
 
             $message = '';
-            if (self::isParticipation($type))
-                $message .= $name . ' ';
 
             $urlSondage = Utils::getUrlSondage($poll->admin_id, true);
             $link = '<a href="' . $urlSondage . '">' . $urlSondage . '</a>' . "\n\n";
 
             switch ($type) {
                 case self::UPDATE_VOTE:
+                    $message .= $name . ' ';
                     $message .= __('Mail', "updated a vote.\nYou can find your poll at the link") . " :\n\n";
                     $message .= $link;
                     break;
                 case self::ADD_VOTE:
+                    $message .= $name . ' ';
                     $message .= __('Mail', "filled a vote.\nYou can find your poll at the link") . " :\n\n";
                     $message .= $link;
                     break;
                 case self::ADD_COMMENT:
+                    $message .= $name . ' ';
                     $message .= __('Mail', "wrote a comment.\nYou can find your poll at the link") . " :\n\n";
                     $message .= $link;
                     break;
-- 
GitLab