From ceda4d90ec16ced0ff8cd85bcdb83c63518ed412 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 12 Jan 2021 15:42:13 +1300 Subject: [PATCH] [NFC] minor code cleanups --- CRM/Contact/Import/Form/DataSource.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/CRM/Contact/Import/Form/DataSource.php b/CRM/Contact/Import/Form/DataSource.php index aa33e7aefd..a95ace603c 100644 --- a/CRM/Contact/Import/Form/DataSource.php +++ b/CRM/Contact/Import/Form/DataSource.php @@ -166,7 +166,7 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { $this->addElement('text', 'fieldSeparator', ts('Import Field Separator'), ['size' => 2]); - if (Civi::settings()->get('address_standardization_provider') == 'USPS') { + if (Civi::settings()->get('address_standardization_provider') === 'USPS') { $this->addElement('checkbox', 'disableUSPS', ts('Disable USPS address validation during import?')); } @@ -233,7 +233,7 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { while (($dataSourceFile = readdir($dataSourceHandle)) !== FALSE) { $fileType = filetype($dataSourceDir . $dataSourceFile); $matches = []; - if (($fileType == 'file' || $fileType == 'link') && + if (($fileType === 'file' || $fileType === 'link') && preg_match('/^(.+)\.php$/', $dataSourceFile, $matches) ) { $dataSourceClass = "CRM_Import_DataSource_" . $matches[1]; @@ -278,8 +278,7 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { $this->set('dataSource', $this->_params['dataSource']); $this->set('skipColumnHeader', CRM_Utils_Array::value('skipColumnHeader', $this->_params)); - $session = CRM_Core_Session::singleton(); - $session->set('dateTypes', $storeParams['dateFormats']); + CRM_Core_Session::singleton()->set('dateTypes', $storeParams['dateFormats']); // Get the PEAR::DB object $dao = new CRM_Core_DAO(); @@ -378,10 +377,9 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { /** * Return a descriptive name for the page, used in wizard header * - * * @return string */ - public function getTitle() { + public function getTitle(): string { return ts('Choose Data Source'); } -- 2.25.1