From e122e55d89d351b1d22979ae15d6c76bb3bbecca Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 5 Apr 2019 13:11:11 -0700 Subject: [PATCH] (NFC) CRM/ - Update to pass new phpcs --- CRM/Contact/BAO/Contact.php | 12 ++++----- CRM/Contact/Page/View/Summary.php | 5 +--- .../Exception/CheckLineItemsException.php | 26 +++++++++---------- CRM/Core/I18n/SchemaStructure.php | 10 +++---- CRM/Dedupe/Merger.php | 3 ++- 5 files changed, 27 insertions(+), 29 deletions(-) diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index f620157027..4a8d50a519 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -2398,12 +2398,12 @@ ORDER BY civicrm_email.is_primary DESC"; 'prefix_id', 'suffix_id', )) && - ($value == '' || !isset($value)) && - ($session->get('authSrc') & (CRM_Core_Permission::AUTH_SRC_CHECKSUM + CRM_Core_Permission::AUTH_SRC_LOGIN)) == 0 || - ($key == 'current_employer' && empty($params['current_employer']))) { - // 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; + ($value == '' || !isset($value)) && + ($session->get('authSrc') & (CRM_Core_Permission::AUTH_SRC_CHECKSUM + CRM_Core_Permission::AUTH_SRC_LOGIN)) == 0 || + ($key == 'current_employer' && empty($params['current_employer']))) { + // 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/Contact/Page/View/Summary.php b/CRM/Contact/Page/View/Summary.php index 79f375ca81..f91a87480b 100644 --- a/CRM/Contact/Page/View/Summary.php +++ b/CRM/Contact/Page/View/Summary.php @@ -411,10 +411,7 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { } elseif ($accessCiviCRM && !empty($this->_viewOptions[$tab['id']])) { $allTabs[] = $tab + [ - 'url' => CRM_Utils_System::url( - "civicrm/contact/view/{$tab['id']}", - "reset=1&cid={$this->_contactId}" - ), + 'url' => CRM_Utils_System::url("civicrm/contact/view/{$tab['id']}", "reset=1&cid={$this->_contactId}"), 'count' => CRM_Contact_BAO_Contact::getCountComponent($tab['id'], $this->_contactId), ]; $weight = $tab['weight'] + 10; diff --git a/CRM/Contribute/Exception/CheckLineItemsException.php b/CRM/Contribute/Exception/CheckLineItemsException.php index d14a3aec98..c1c0d3a914 100644 --- a/CRM/Contribute/Exception/CheckLineItemsException.php +++ b/CRM/Contribute/Exception/CheckLineItemsException.php @@ -1,13 +1,13 @@ - [ @@ -211,7 +211,7 @@ class CRM_Core_I18n_SchemaStructure { * Indices for translatable fields. */ public static function &indices() { - static $result = null; + static $result = NULL; if (!$result) { $result = [ 'civicrm_custom_group' => [ @@ -255,7 +255,7 @@ class CRM_Core_I18n_SchemaStructure { * Array of names of tables with fields that can be translated. */ static function &tables() { - static $result = null; + static $result = NULL; if (!$result) { $result = array_keys(self::columns()); } @@ -269,7 +269,7 @@ class CRM_Core_I18n_SchemaStructure { * Array of the widgets for editing translatable fields. */ static function &widgets() { - static $result = null; + static $result = NULL; if (!$result) { $result = [ 'civicrm_location_type' => [ diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index ca2f28d0a5..3cab5581bb 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -472,7 +472,8 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m "return" => "id", ] ) - )); + ) + ); if (!empty($membershipIDs)) { civicrm_api3("Membership", "get", [ -- 2.25.1