From 35dd6a265c50a3207ca75132edbfb1272afc72a7 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 19 Apr 2022 11:21:38 +1200 Subject: [PATCH] [REF] [Import] remove pointless fini functions. These never do anything - there are there only through copy & paste + a the abstract class requiring them. In fact all the abstract functions are dumb - the are only called internally within the classes so I have gotten rid of the abstractness so they can be removed at will. import makes sense - but the signature doesn't... --- CRM/Activity/Import/Parser/Activity.php | 6 ---- CRM/Contact/Import/Parser/Contact.php | 8 ----- CRM/Contribute/Import/Parser/Contribution.php | 7 ---- CRM/Event/Import/Parser/Participant.php | 9 ----- CRM/Import/Parser.php | 34 ------------------- CRM/Member/Import/Parser/Membership.php | 9 ----- 6 files changed, 73 deletions(-) diff --git a/CRM/Activity/Import/Parser/Activity.php b/CRM/Activity/Import/Parser/Activity.php index 62a8b29d32..8275b2f242 100644 --- a/CRM/Activity/Import/Parser/Activity.php +++ b/CRM/Activity/Import/Parser/Activity.php @@ -69,11 +69,6 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Import_Parser { $this->_mapperKeys = $mapperKeys; } - /** - * Function of undocumented functionality required by the interface. - */ - protected function fini() {} - /** * The initializer code, called before the processing. */ @@ -656,7 +651,6 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Import_Parser { self::exportCSV($this->_duplicateFileName, $headers, $this->_duplicates); } } - return $this->fini(); } /** diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index cb955236a5..bf944e2570 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -1306,12 +1306,6 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { return $this->_newRelatedContacts; } - /** - * The initializer code, called before the processing. - */ - public function fini() { - } - /** * Check if an error in custom data. * @@ -2788,8 +2782,6 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { self::exportCSV($this->_errorFileName, $headers, $this->_unparsedAddresses); } } - //echo "$this->_totalCount,$this->_invalidRowCount,$this->_conflictCount,$this->_duplicateCount"; - return $this->fini(); } /** diff --git a/CRM/Contribute/Import/Parser/Contribution.php b/CRM/Contribute/Import/Parser/Contribution.php index 933f9ad2f5..0ca8ed3d0a 100644 --- a/CRM/Contribute/Import/Parser/Contribution.php +++ b/CRM/Contribute/Import/Parser/Contribution.php @@ -418,7 +418,6 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser { self::exportCSV($this->_duplicateFileName, $headers, $this->_duplicates); } } - return $this->fini(); } /** @@ -1111,12 +1110,6 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser { return $this->_newContributions; } - /** - * The initializer code, called before the processing. - */ - public function fini() { - } - /** * Format date fields from input to mysql. * diff --git a/CRM/Event/Import/Parser/Participant.php b/CRM/Event/Import/Parser/Participant.php index 9a435bcdc9..102d769639 100644 --- a/CRM/Event/Import/Parser/Participant.php +++ b/CRM/Event/Import/Parser/Participant.php @@ -491,14 +491,6 @@ class CRM_Event_Import_Parser_Participant extends CRM_Import_Parser { return $this->_newParticipants; } - /** - * The initializer code, called before the processing - * - * @return void - */ - public function fini() { - } - /** * Format values * @@ -930,7 +922,6 @@ class CRM_Event_Import_Parser_Participant extends CRM_Import_Parser { self::exportCSV($this->_duplicateFileName, $headers, $this->_duplicates); } } - return $this->fini(); } /** diff --git a/CRM/Import/Parser.php b/CRM/Import/Parser.php index 979cbaeab1..8cbea455a3 100644 --- a/CRM/Import/Parser.php +++ b/CRM/Import/Parser.php @@ -212,40 +212,6 @@ abstract class CRM_Import_Parser { $this->_maxLinesToProcess = 0; } - /** - * Abstract function definitions. - */ - abstract protected function init(); - - /** - * @return mixed - */ - abstract protected function fini(); - - /** - * Preview. - * - * @param array $values - * - * @return mixed - */ - abstract protected function preview(&$values); - - /** - * @param $values - * - * @return mixed - */ - abstract protected function summary(&$values); - - /** - * @param $onDuplicate - * @param $values - * - * @return mixed - */ - abstract protected function import($onDuplicate, &$values); - /** * Set and validate field values. * diff --git a/CRM/Member/Import/Parser/Membership.php b/CRM/Member/Import/Parser/Membership.php index 1d514d6cfa..c28249ebaa 100644 --- a/CRM/Member/Import/Parser/Membership.php +++ b/CRM/Member/Import/Parser/Membership.php @@ -289,7 +289,6 @@ class CRM_Member_Import_Parser_Membership extends CRM_Import_Parser { self::exportCSV($this->_duplicateFileName, $headers, $this->_duplicates); } } - return $this->fini(); } /** @@ -938,14 +937,6 @@ class CRM_Member_Import_Parser_Membership extends CRM_Import_Parser { return $this->_newMemberships; } - /** - * The initializer code, called before the processing - * - * @return void - */ - public function fini() { - } - /** * to calculate join, start and end dates * -- 2.25.1