Skip to content

Commit

Permalink
Merge pull request #23517 from eileenmcnaughton/import_comments
Browse files Browse the repository at this point in the history
[NFC] Improve comment blocks for mapper
  • Loading branch information
seamuslee001 authored May 20, 2022
2 parents c11db2d + b6df6c1 commit 0560b88
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
11 changes: 10 additions & 1 deletion CRM/Contact/Import/Parser/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -2051,7 +2051,9 @@ public function deprecated_contact_check_params(
/**
* Run import.
*
* @param array $mapper
* @param array $mapper Mapping as entered on MapField form.
* e.g [['first_name']['email', 1]].
* {@see \CRM_Contact_Import_Parser_Contact::getMappingFieldFromMapperInput}
* @param int $mode
* @param int $statusID
*
Expand Down Expand Up @@ -2648,6 +2650,13 @@ protected function fillPrimary(&$params, $values, $entity, $contactID) {
* 1]
*
* @param array $fieldMapping
* Field as submitted on the MapField form - this is a non-associative array,
* the keys of which depend on the data/ field. Generally it will be one of
* [$fieldName],
* [$fieldName, $locationTypeID, $phoneTypeIDOrIMProviderIDIfRelevant],
* [$fieldName, $websiteTypeID],
* If the mapping is for a related contact it will be as above but the first
* key will be the relationship key - eg. 5_a_b.
* @param int $mappingID
* @param int $columnNumber
*
Expand Down
4 changes: 3 additions & 1 deletion tests/phpunit/CRM/Contact/Import/Form/MapFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ public function tearDown(): void {
* @dataProvider getSubmitData
*
* @param array $params
* @param array $mapper
* @param array $mapper Mapping as entered on MapField form.
* e.g [['first_name']['email', 1]].
* {@see \CRM_Contact_Import_Parser_Contact::getMappingFieldFromMapperInput}
* @param array $expecteds
*
* @throws \API_Exception
Expand Down
14 changes: 11 additions & 3 deletions tests/phpunit/CRM/Contact/Import/Parser/ContactTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -870,10 +870,13 @@ public function testCustomFieldValidation(): void {
* @dataProvider validateDataProvider
*
* @param string $csv
* @param array $mapper
* @param array $mapper Mapping as entered on MapField form.
* e.g [['first_name']['email', 1]].
* {@see \CRM_Contact_Import_Parser_Contact::getMappingFieldFromMapperInput}
* @param string $expectedError
* @param array $submittedValues
*
*
* @throws \API_Exception
*/
public function testValidation(string $csv, array $mapper, string $expectedError = '', $submittedValues = []): void {
Expand Down Expand Up @@ -1300,7 +1303,9 @@ protected function runImport(array $originalValues, $onDuplicateAction, $expecte

/**
* @param string $csv
* @param array $mapper
* @param array $mapper Mapping as entered on MapField form.
* e.g [['first_name']['email', 1]].
* {@see \CRM_Contact_Import_Parser_Contact::getMappingFieldFromMapperInput}
* @param array $submittedValues
*
* @return array
Expand Down Expand Up @@ -1505,6 +1510,7 @@ protected function getUserJobID($submittedValues = []) {
* @param string $csv Name of csv file.
* @param array $mapper Mapping as entered on MapField form.
* e.g [['first_name']['email', 1]].
* {@see \CRM_Contact_Import_Parser_Contact::getMappingFieldFromMapperInput}
* @param array $submittedValues
* Any submitted values overrides.
*
Expand All @@ -1524,6 +1530,7 @@ protected function validateCSV(string $csv, array $mapper, $submittedValues): vo
* @param string $csv Name of csv file.
* @param array $mapper Mapping as entered on MapField form.
* e.g [['first_name']['email', 1]].
* {@see \CRM_Contact_Import_Parser_Contact::getMappingFieldFromMapperInput}
* @param array $submittedValues
*/
protected function importCSV(string $csv, array $mapper, array $submittedValues = []): void {
Expand Down Expand Up @@ -1556,7 +1563,8 @@ protected function importCSV(string $csv, array $mapper, array $submittedValues

/**
* @param string $csv
* @param array $mapper
* @param array $mapper Mapping as entered on MapField form.
* e.g [['first_name']['email', 1]].
* @param string $field
* @param array $submittedValues
* Values submitted in the form process.
Expand Down

0 comments on commit 0560b88

Please sign in to comment.