From 0cca0bf43e5436c690899b32b013d1416cb73ba1 Mon Sep 17 00:00:00 2001 From: JohnFF Date: Thu, 5 Jun 2014 17:35:23 +0100 Subject: [PATCH] Update Participant.php Removed 3 instances of assignment in if operators. This is ambiguous and against the Civi coding standards. --- CRM/Event/BAO/Participant.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php index 407c15c30c73..605338e345dc 100644 --- a/CRM/Event/BAO/Participant.php +++ b/CRM/Event/BAO/Participant.php @@ -952,7 +952,8 @@ static function fixEventLevel(&$eventLevel) { $eventLevel = implode(', ', explode(CRM_Core_DAO::VALUE_SEPARATOR, substr($eventLevel, 1, -1) )); - if ($pos = strrpos($eventLevel, '(multiple participants)', 0)) { + $pos = strrpos($eventLevel, '(multiple participants)', 0); + if ($pos) { $eventLevel = substr_replace($eventLevel, "", $pos - 3, 1); } } @@ -1430,7 +1431,8 @@ static function sendTransitionParticipantMail( return $mailSent; } - if ($toEmail = CRM_Utils_Array::value('email', $contactDetails)) { + $toEmail = CRM_Utils_Array::value('email', $contactDetails); + if ($toEmail) { $contactId = $participantValues['contact_id']; $participantName = $contactDetails['display_name']; @@ -1439,7 +1441,8 @@ static function sendTransitionParticipantMail( $checksumValue = NULL; if ($mailType == 'Confirm' && !$participantValues['registered_by_id']) { $checksumLife = 'inf'; - if ($endDate = CRM_Utils_Array::value('end_date', $eventDetails)) { + $endDate = CRM_Utils_Array::value('end_date', $eventDetails); + if ($endDate) { $checksumLife = (CRM_Utils_Date::unixTime($endDate) - time()) / (60 * 60); } $checksumValue = CRM_Contact_BAO_Contact_Utils::generateChecksum($contactId, NULL, $checksumLife); @@ -1774,4 +1777,3 @@ static function deleteContactParticipant($contactId) { } } } -