diff --git a/CRM/Activity/Form/Task/PDF.php b/CRM/Activity/Form/Task/PDF.php index 2638b3263b89..b64ed6640645 100644 --- a/CRM/Activity/Form/Task/PDF.php +++ b/CRM/Activity/Form/Task/PDF.php @@ -35,6 +35,7 @@ * This class provides the functionality to create PDF/Word letters for activities. */ class CRM_Activity_Form_Task_PDF extends CRM_Activity_Form_Task { + /** * Build all the data structures needed to build the form. */ diff --git a/CRM/Activity/Tokens.php b/CRM/Activity/Tokens.php index 0f11f88a9b56..cb6e34e38baa 100644 --- a/CRM/Activity/Tokens.php +++ b/CRM/Activity/Tokens.php @@ -51,8 +51,10 @@ class CRM_Activity_Tokens extends \Civi\Token\AbstractTokenSubscriber { private $customFieldTokens; private $specialTokens; - // Mapping from tokenName to api return field - // Use lists since we might need multiple fields + /** + * Mapping from tokenName to api return field + * Use lists since we might need multiple fields + */ private static $fieldMapping = [ 'activity_id' => ['id'], 'activity_type' => ['activity_type_id'], @@ -75,8 +77,7 @@ public function __construct() { * @inheritDoc */ public function checkActive(\Civi\Token\TokenProcessor $processor) { - return - in_array('activityId', $processor->context['schema']) || + return in_array('activityId', $processor->context['schema']) || (!empty($processor->context['actionMapping']) && $processor->context['actionMapping']->getEntity() === 'civicrm_activity'); } @@ -126,7 +127,8 @@ public function alterActionScheduleQuery(\Civi\ActionSchedule\Event\MailingQuery * @return array list of fields needed to generate those tokens */ public function getReturnFields($tokens) { - $fields = ['id']; // Make sure we always return something + // Make sure we always return something + $fields = ['id']; foreach (array_intersect($tokens, array_merge(array_keys(self::getBasicTokens()), array_keys(self::getCustomFieldTokens())) @@ -249,7 +251,7 @@ public function evaluateToken(\Civi\Token\TokenRow $row, $entity, $field, $prefe if (in_array($field, ['activity_date_time', 'created_date'])) { $row->tokens($entity, $field, \CRM_Utils_Date::customFormat($activity->$field)); } - elseif (isset($mapping[$field]) AND (isset($activity->{$mapping[$field]}))) { + elseif (isset($mapping[$field]) and (isset($activity->{$mapping[$field]}))) { $row->tokens($entity, $field, $activity->{$mapping[$field]}); } elseif (in_array($field, ['activity_type'])) { diff --git a/CRM/Core/Form/Task/PDFLetterCommon.php b/CRM/Core/Form/Task/PDFLetterCommon.php index ec4e17445d06..d6ae8a9803db 100644 --- a/CRM/Core/Form/Task/PDFLetterCommon.php +++ b/CRM/Core/Form/Task/PDFLetterCommon.php @@ -344,8 +344,9 @@ public static function formatMessage(&$message) { * Render html from rows * @param array $rows Array of \Civi\Token\TokenRow * @param string $msgPart The name registered with the TokenProcessor - * @return string $html if formValues['is_unit_test'] is true, - * otherwise outputs document to browser + * @param string $formValues The values submitted through the form + * @return string $html if formValues['is_unit_test'] is true, + * otherwise outputs document to browser * */ public static function renderFromRows($rows, $msgPart, $formValues) {