Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFC] code formatting #15424

Merged
merged 1 commit into from
Oct 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions CRM/Contact/Form/Edit/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class CRM_Contact_Form_Edit_Address {
* False, if we want to skip the address sharing features.
* @param bool $inlineEdit
* True when edit used in inline edit.
*
* @throws \CiviCRM_API3_Exception
*/
public static function buildQuickForm(&$form, $addressBlockCount = NULL, $sharing = TRUE, $inlineEdit = FALSE) {
// passing this via the session is AWFUL. we need to fix this
Expand Down Expand Up @@ -130,13 +132,13 @@ public static function buildQuickForm(&$form, $addressBlockCount = NULL, $sharin
continue;
}
}
if ($name == 'address_name') {
if ($name === 'address_name') {
$name = 'name';
}

$params = ['entity' => 'address'];

if ($name == 'postal_code_suffix') {
if ($name === 'postal_code_suffix') {
$params['label'] = ts('Suffix');
}

Expand Down Expand Up @@ -366,7 +368,7 @@ public static function storeRequiredCustomDataInfo(&$form, $groupTree) {
$requireOmission = NULL;
foreach ($groupTree as $csId => $csVal) {
// only process Address entity fields
if ($csVal['extends'] != 'Address') {
if ($csVal['extends'] !== 'Address') {
continue;
}

Expand All @@ -391,6 +393,9 @@ public static function storeRequiredCustomDataInfo(&$form, $groupTree) {
* @param CRM_Core_Form $form
* @param int $entityId
* @param int $blockId
*
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
*/
protected static function addCustomDataToForm(&$form, $entityId, $blockId) {
$groupTree = CRM_Core_BAO_CustomGroup::getTree('Address', NULL, $entityId);
Expand All @@ -417,7 +422,7 @@ protected static function addCustomDataToForm(&$form, $entityId, $blockId) {
continue;
}

// inorder to set correct defaults for checkbox custom data, we need to converted flat key to array
// in order to set correct defaults for checkbox custom data, we need to converted flat key to array
// this works for all types custom data
$keyValues = explode('[', str_replace(']', '', $key));
$addressDefaults[$keyValues[0]][$keyValues[1]][$keyValues[2]] = $val;
Expand Down