* @return array
*/
protected function getPassthruTokens() {
- return array(
+ return [
'contribution_page_id',
'receive_date',
'total_amount',
'receipt_date',
'thankyou_date',
'tax_amount',
- );
+ ];
}
/**
* @return array
*/
protected function getAliasTokens() {
- return array(
+ return [
'id' => 'contribution_id',
'payment_instrument' => 'payment_instrument_id',
'source' => 'contribution_source',
'status' => 'contribution_status_id',
'type' => 'financial_type_id',
- );
+ ];
}
/**
* @return bool
*/
public function checkActive(\Civi\Token\TokenProcessor $processor) {
- return
- !empty($processor->context['actionMapping'])
+ return !empty($processor->context['actionMapping'])
&& $processor->context['actionMapping']->getEntity() === 'civicrm_contribution';
}
$fieldValue = isset($actionSearchResult->{"contrib_$field"}) ? $actionSearchResult->{"contrib_$field"} : NULL;
$aliasTokens = $this->getAliasTokens();
- if (in_array($field, array('total_amount', 'fee_amount', 'net_amount'))) {
+ if (in_array($field, ['total_amount', 'fee_amount', 'net_amount'])) {
return $row->format('text/plain')->tokens($entity, $field,
\CRM_Utils_Money::format($fieldValue, $actionSearchResult->contrib_currency));
}