From: Tim Otten Date: Tue, 6 Jan 2015 21:21:22 +0000 (-0800) Subject: INFRA-132 - CRM/Import - phpcbf X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3a05d67e49daf5019bfb24b64db9280fdb99c85f;p=civicrm-core.git INFRA-132 - CRM/Import - phpcbf --- diff --git a/CRM/Import/DataSource/CSV.php b/CRM/Import/DataSource/CSV.php index 1c3dda4d7f..a489006f2b 100644 --- a/CRM/Import/DataSource/CSV.php +++ b/CRM/Import/DataSource/CSV.php @@ -51,7 +51,8 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource { * Set variables up before form is built * */ - public function preProcess(&$form) {} + public function preProcess(&$form) { + } /** * This is function is called by the form object to get the DataSource's @@ -117,8 +118,8 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource { */ private static function _CsvToTable(&$db, $file, - $headers = FALSE, - $table = NULL, + $headers = FALSE, + $table = NULL, $fieldSeparator = ',' ) { $result = array(); @@ -153,7 +154,6 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource { $duplicateColName = TRUE; } - // need to truncate values per mysql field name length limits // mysql allows 64, but we need to account for appending colKey // CRM-9079 @@ -175,11 +175,13 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource { } // CRM-4881: we need to quote column names, as they may be MySQL reserved words - foreach ($columns as & $column) $column = "`$column`"; + foreach ($columns as & $column) { $column = "`$column`"; + } } else { $columns = array(); - foreach ($firstrow as $i => $_) $columns[] = "col_$i"; + foreach ($firstrow as $i => $_) { $columns[] = "col_$i"; + } } // FIXME: we should regen this table's name if it exists rather than drop it diff --git a/CRM/Import/DataSource/SQL.php b/CRM/Import/DataSource/SQL.php index 56aa139da2..ca4eb2a7cc 100644 --- a/CRM/Import/DataSource/SQL.php +++ b/CRM/Import/DataSource/SQL.php @@ -49,7 +49,8 @@ class CRM_Import_DataSource_SQL extends CRM_Import_DataSource { * Set variables up before form is built * */ - public function preProcess(&$form) {} + public function preProcess(&$form) { + } /** * This is function is called by the form object to get the DataSource's @@ -94,7 +95,7 @@ class CRM_Import_DataSource_SQL extends CRM_Import_DataSource { public function postProcess(&$params, &$db, &$form) { $importJob = new CRM_Contact_Import_ImportJob( CRM_Utils_Array::value( 'import_table_name', $params ), - $params['sqlQuery'], true + $params['sqlQuery'], TRUE ); $form->set('importTableName', $importJob->getTableName());