From d9f93da9a7d52b4da69fbf5a50540e005146d2d7 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sun, 27 Apr 2014 14:04:03 -0700 Subject: [PATCH] formatting & comment fixes --- CRM/Contact/BAO/Contact.php | 29 +++++++++++++++++------------ CRM/Core/DAO.php | 15 +++++++++------ CRM/Mailing/BAO/Component.php | 2 +- CRM/Mailing/Form/Component.php | 3 +++ CRM/Member/BAO/MembershipStatus.php | 6 +++++- CRM/Member/BAO/MembershipType.php | 2 +- api/v3/MailingComponent.php | 8 ++++++++ 7 files changed, 44 insertions(+), 21 deletions(-) diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 236b3630f2..cf82d7e8eb 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -252,10 +252,13 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact { * * This function is invoked from within the web form layer and also from the api layer * - * @param array $params (reference ) an assoc array of name/value pairs - * @param boolean $fixAddress if we need to fix address + * @param array $params (reference ) an assoc array of name/value pairs + * @param boolean $fixAddress if we need to fix address * @param boolean $invokeHooks if we need to invoke hooks * + * @param bool $skipDelete + * + * @throws Exception * @return object CRM_Contact_BAO_Contact object * @access public * @static @@ -450,6 +453,8 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact { * * @param int $id the contactId * + * @param bool $type + * * @return array the displayName and contactImage for this contact * @access public * @static @@ -2070,7 +2075,7 @@ ORDER BY civicrm_email.is_primary DESC"; if (($session->get('authSrc') & (CRM_Core_Permission::AUTH_SRC_CHECKSUM + CRM_Core_Permission::AUTH_SRC_LOGIN)) == 0 && ($value == '' || !isset($value))) { continue; - } + } $valueId = NULL; if (!empty($params['customRecordValues'])) { @@ -2127,21 +2132,21 @@ ORDER BY civicrm_email.is_primary DESC"; } } } - else if (in_array($key, - array('nick_name', - 'job_title', - 'middle_name', - 'birth_date', + else if (in_array($key, + array('nick_name', + 'job_title', + 'middle_name', + 'birth_date', 'gender_id', - 'current_employer', - 'prefix_id', + 'current_employer', + 'prefix_id', 'suffix_id')) && ($value == '' || !isset($value)) && ($session->get('authSrc') & (CRM_Core_Permission::AUTH_SRC_CHECKSUM + CRM_Core_Permission::AUTH_SRC_LOGIN)) == 0) { - // CRM-10128: if auth source is not checksum / login && $value is blank, do not fill $data with empty value + // CRM-10128: if auth source is not checksum / login && $value is blank, do not fill $data with empty value // to avoid update with empty values continue; - } + } else { $data[$key] = $value; } diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 4652b79e79..7596dee47d 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -1255,9 +1255,11 @@ SELECT contact_id return self::escapeString($string); } - //Creates a test object, including any required objects it needs via recursion - //createOnly: only create in database, do not store or return the objects (useful for perf testing) - //ONLY USE FOR TESTING + /** + * Creates a test object, including any required objects it needs via recursion + *createOnly: only create in database, do not store or return the objects (useful for perf testing) + *ONLY USE FOR TESTING + */ static function createTestObject( $daoName, $params = array(), @@ -1435,9 +1437,10 @@ SELECT contact_id else return $objects; } - //deletes the this object plus any dependent objects that are associated with it - //ONLY USE FOR TESTING - + /** + * deletes the this object plus any dependent objects that are associated with it + * ONLY USE FOR TESTING + */ static function deleteTestObjects($daoName, $params = array( )) { //this is a test function also backtrace is set for the test suite it sometimes unsets itself diff --git a/CRM/Mailing/BAO/Component.php b/CRM/Mailing/BAO/Component.php index 3e094e55de..a1364b9f10 100644 --- a/CRM/Mailing/BAO/Component.php +++ b/CRM/Mailing/BAO/Component.php @@ -82,7 +82,7 @@ class CRM_Mailing_BAO_Component extends CRM_Mailing_DAO_Component { * Create and Update mailing component * * @param array $params (reference ) an assoc array of name/value pairs - * @param array $ids (reference ) the array that holds all the db ids + * @param array $ids (deprecated) the array that holds all the db ids * * @return object CRM_Mailing_BAO_Component object * diff --git a/CRM/Mailing/Form/Component.php b/CRM/Mailing/Form/Component.php index e830dc3354..7704167b58 100644 --- a/CRM/Mailing/Form/Component.php +++ b/CRM/Mailing/Form/Component.php @@ -152,6 +152,9 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form { * * @param array $params (ref.) an assoc array of name/value pairs * + * @param $files + * @param $options + * * @return mixed true or array of errors * @access public * @static diff --git a/CRM/Member/BAO/MembershipStatus.php b/CRM/Member/BAO/MembershipStatus.php index f0586282ea..5a32db7f01 100644 --- a/CRM/Member/BAO/MembershipStatus.php +++ b/CRM/Member/BAO/MembershipStatus.php @@ -86,8 +86,10 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus { /** * Takes an associative array and creates a membership Status object * See http://wiki.civicrm.org/confluence/display/CRM/Database+layer - * @param array $params (reference ) an assoc array of name/value pairs * + * @param array $params (reference ) an assoc array of name/value pairs + * + * @throws Exception * @return object CRM_Member_BAO_MembershipStatus object * @access public * @static @@ -158,6 +160,8 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus { * Function to get membership status * * @param int $membershipStatusId + * + * @return array * @static */ public static function getMembershipStatus($membershipStatusId) { diff --git a/CRM/Member/BAO/MembershipType.php b/CRM/Member/BAO/MembershipType.php index 6689d1d3e8..a9ac9bf2a8 100644 --- a/CRM/Member/BAO/MembershipType.php +++ b/CRM/Member/BAO/MembershipType.php @@ -108,7 +108,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { $membershipType->id = CRM_Utils_Array::value('membershipType', $ids); - // $previousID is the old organization id for memberhip type i.e 'member_of_contact_id'. This is used when an oganization is changed. + // $previousID is the old organization id for membership type i.e 'member_of_contact_id'. This is used when an oganization is changed. $previousID = NULL; if ($membershipType->id) { $previousID = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $membershipType->id, 'member_of_contact_id'); diff --git a/api/v3/MailingComponent.php b/api/v3/MailingComponent.php index eca19e5c24..811fdefb85 100644 --- a/api/v3/MailingComponent.php +++ b/api/v3/MailingComponent.php @@ -41,6 +41,9 @@ * {@getfields mailing_component_create} * @example mailing_componentCreate.php * + * @param $params + * + * @throws API_Exception * @return array of newly created mailing_component property values. * @access public */ @@ -55,6 +58,8 @@ function civicrm_api3_mailing_component_create($params) { * {@getfields mailing_component_get} * @example mailing_componentCreate.php * + * @param $params + * * @return array of retrieved mailing_component property values. * @access public */ @@ -69,6 +74,9 @@ function civicrm_api3_mailing_component_get($params) { * {@getfields mailing_component_delete} * @example mailing_componentCreate.php * + * @param $params + * + * @throws API_Exception * @return array of deleted values. * @access public */ -- 2.25.1