From: eileen Date: Mon, 6 Jun 2016 20:20:50 +0000 (-0600) Subject: CRM-18701 tidy up, stop setting an array key & use a variable. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0f28809863ee6e1de7d9b0c083c64c092f3ac431;p=civicrm-core.git CRM-18701 tidy up, stop setting an array key & use a variable. The array key is returned to the calling function but grepping did not find any more instances of it so we should limit it's scope to the function that uses it. Really we want to pass in as a non-reference or else it's too unpredictable but this is just a small step --- diff --git a/CRM/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php index 93c205b674..ff934adf20 100644 --- a/CRM/Price/BAO/PriceSet.php +++ b/CRM/Price/BAO/PriceSet.php @@ -851,20 +851,20 @@ WHERE id = %1"; break; case 'CheckBox': - $params['amount_priceset_level_checkbox'] = $optionIds = array(); + $amount_price_set_level_checkbox = $optionIds = array(); foreach ($params["price_{$id}"] as $optionId => $option) { $optionIds[] = $optionId; $optionLabel = $field['options'][$optionId]['label']; - $params['amount_priceset_level_checkbox']["{$field['options'][$optionId]['id']}"] = $optionLabel; + $amount_price_set_level_checkbox["{$field['options'][$optionId]['id']}"] = $optionLabel; if (isset($checkboxLevel)) { $checkboxLevel = array_unique(array_merge( $checkboxLevel, - array_keys($params['amount_priceset_level_checkbox']) + array_keys($amount_price_set_level_checkbox) ) ); } else { - $checkboxLevel = array_keys($params['amount_priceset_level_checkbox']); + $checkboxLevel = array_keys($amount_price_set_level_checkbox); } } CRM_Price_BAO_LineItem::format($id, $params, $field, $lineItem);