From 54f1aa2a72e00fa2cfca869db6803e157ca337ee Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 13 Jan 2015 13:27:34 +1300 Subject: [PATCH] tidy up some unused params --- api/v3/Address.php | 1 - api/v3/Contact.php | 3 +-- api/v3/EntityTag.php | 1 - api/v3/MailingJob.php | 3 +-- api/v3/MailingRecipients.php | 4 +--- api/v3/PaymentProcessorType.php | 8 +++----- api/v3/Pledge.php | 5 ++--- 7 files changed, 8 insertions(+), 17 deletions(-) diff --git a/api/v3/Address.php b/api/v3/Address.php index f1f9185682..ac3bc0a3df 100644 --- a/api/v3/Address.php +++ b/api/v3/Address.php @@ -85,7 +85,6 @@ function civicrm_api3_address_create(&$params) { return civicrm_api3_create_error("Address is not created or updated "); } else { - $values = array(); $values = _civicrm_api3_dao_to_array($addressBAO, $params); return civicrm_api3_create_success($values, $params, 'address', $addressBAO); } diff --git a/api/v3/Contact.php b/api/v3/Contact.php index d4179d0f81..b06e8d9e65 100644 --- a/api/v3/Contact.php +++ b/api/v3/Contact.php @@ -401,8 +401,7 @@ function _civicrm_api3_contact_check_params(&$params, $dupeCheck = TRUE, $dupeEr * @param int $contactID * If present the contact with that ID is updated. * - * @return CRM_Contact_BAO_Contact - * @access public + * @return CRM_Contact_BAO_Contact|CRM_Core_Error */ function _civicrm_api3_contact_update($params, $contactID = NULL) { //@todo - doesn't contact create support 'id' which is already set- check & remove diff --git a/api/v3/EntityTag.php b/api/v3/EntityTag.php index cf265e226b..249515640d 100644 --- a/api/v3/EntityTag.php +++ b/api/v3/EntityTag.php @@ -120,7 +120,6 @@ function _civicrm_api3_entity_tag_delete_spec(&$params) { function _civicrm_api3_entity_tag_common($params, $op = 'add') { $entityIDs = array(); - $tagsIDs = array(); $entityTable = 'civicrm_contact'; if (is_array($params)) { foreach ($params as $n => $v) { diff --git a/api/v3/MailingJob.php b/api/v3/MailingJob.php index 05c027bef1..9d1a702706 100644 --- a/api/v3/MailingJob.php +++ b/api/v3/MailingJob.php @@ -64,13 +64,12 @@ function _civicrm_api3_mailing_job_create_spec(&$params) { * * @param array $params * Array of one or more valid. - * @param array $ids * * @return array * API return Array of matching mailing jobs * {@getfields mailing_job_get} */ -function civicrm_api3_mailing_job_get($params, $ids = array()) { +function civicrm_api3_mailing_job_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); } diff --git a/api/v3/MailingRecipients.php b/api/v3/MailingRecipients.php index b2ea3a4fee..99042f32d7 100644 --- a/api/v3/MailingRecipients.php +++ b/api/v3/MailingRecipients.php @@ -42,12 +42,10 @@ * * @param array $params * Array of one or more valid. - * @param array $ids * * @return array * API return Array of matching mailing jobs - * {@getfields mailing_recipient_get} */ -function civicrm_api3_mailing_recipients_get($params, $ids = array()) { +function civicrm_api3_mailing_recipients_get($params)) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); } diff --git a/api/v3/PaymentProcessorType.php b/api/v3/PaymentProcessorType.php index aa2a9e5ac9..370361eb3e 100644 --- a/api/v3/PaymentProcessorType.php +++ b/api/v3/PaymentProcessorType.php @@ -49,19 +49,17 @@ * @return array */ function civicrm_api3_payment_processor_type_create($params) { - $ids = array(); if (isset($params['id']) && !CRM_Utils_Rule::integer($params['id'])) { return civicrm_api3_create_error('Invalid value for payment_processor type ID'); } - $payProcType = new CRM_Financial_BAO_PaymentProcessorType(); - $payProcType = CRM_Financial_BAO_PaymentProcessorType::create($params); + $paymentProcessorType = CRM_Financial_BAO_PaymentProcessorType::create($params); $relType = array(); - _civicrm_api3_object_to_array($payProcType, $relType[$payProcType->id]); + _civicrm_api3_object_to_array($paymentProcessorType, $relType[$paymentProcessorType->id]); - return civicrm_api3_create_success($relType, $params, 'payment_processor_type', 'create', $payProcType); + return civicrm_api3_create_success($relType, $params, 'payment_processor_type', 'create', $paymentProcessorType); } /** diff --git a/api/v3/Pledge.php b/api/v3/Pledge.php index 5767a97744..c5b0e35754 100644 --- a/api/v3/Pledge.php +++ b/api/v3/Pledge.php @@ -164,11 +164,10 @@ function _civicrm_api3_pledge_get_defaults() { * * @param array $values * The reformatted properties that we can use internally. - * @param bool $create * - * @return array|CRM_Error + * @return array|CRM_Core_Error */ -function _civicrm_api3_pledge_format_params(&$values, $create = FALSE) { +function _civicrm_api3_pledge_format_params(&$values) { // probably most of the below can be removed.... just needs a little more review if (array_key_exists('original_installment_amount', $values)) { -- 2.25.1