X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FMember%2FImport%2FParser.php;h=3edd35bb547186ad97a64f5114aff3220d638e87;hb=f60ca01e67ceb8c0afc5c3d189793ea269437f80;hp=b36197bbac790e336d3ae870184ba3173b302758;hpb=30b6117f306e9e037c1b9776848cdf8fd6d7ad45;p=civicrm-core.git diff --git a/CRM/Member/Import/Parser.php b/CRM/Member/Import/Parser.php index b36197bbac..3edd35bb54 100644 --- a/CRM/Member/Import/Parser.php +++ b/CRM/Member/Import/Parser.php @@ -36,29 +36,28 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser { protected $_fileName; - /**#@+ - * @var integer - */ - /** * Imported file size + * @var int */ protected $_fileSize; /** * Seperator being used + * @var string */ protected $_seperator; /** * Total number of lines in file + * @var int */ protected $_lineCount; /** * Whether the file has a column header or not * - * @var boolean + * @var bool */ protected $_haveColumnHeader; @@ -70,6 +69,8 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser { * @param int $mode * @param int $contactType * @param int $onDuplicate + * @param int $statusID + * @param int $totalRowCount * * @return mixed * @throws Exception @@ -118,14 +119,14 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser { $this->_invalidRowCount = $this->_validCount = 0; $this->_totalCount = $this->_conflictCount = 0; - $this->_errors = array(); - $this->_warnings = array(); - $this->_conflicts = array(); + $this->_errors = []; + $this->_warnings = []; + $this->_conflicts = []; $this->_fileSize = number_format(filesize($fileName) / 1024.0, 2); if ($mode == self::MODE_MAPFIELD) { - $this->_rows = array(); + $this->_rows = []; } else { $this->_activeFieldCount = count($this->_activeFields); @@ -250,27 +251,27 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser { } if ($this->_invalidRowCount) { // removed view url for invlaid contacts - $headers = array_merge(array( + $headers = array_merge([ ts('Line Number'), ts('Reason'), - ), $customHeaders); + ], $customHeaders); $this->_errorFileName = self::errorFileName(self::ERROR); self::exportCSV($this->_errorFileName, $headers, $this->_errors); } if ($this->_conflictCount) { - $headers = array_merge(array( + $headers = array_merge([ ts('Line Number'), ts('Reason'), - ), $customHeaders); + ], $customHeaders); $this->_conflictFileName = self::errorFileName(self::CONFLICT); self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts); } if ($this->_duplicateCount) { - $headers = array_merge(array( + $headers = array_merge([ ts('Line Number'), ts('View Membership URL'), - ), $customHeaders); + ], $customHeaders); $this->_duplicateFileName = self::errorFileName(self::DUPLICATE); self::exportCSV($this->_duplicateFileName, $headers, $this->_duplicates); @@ -306,7 +307,7 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser { * (reference ) associative array of name/value pairs */ public function &getActiveFieldParams() { - $params = array(); + $params = []; for ($i = 0; $i < $this->_activeFieldCount; $i++) { if (isset($this->_activeFields[$i]->_value) && !isset($params[$this->_activeFields[$i]->_name]) @@ -411,7 +412,7 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser { * @return void */ public static function exportCSV($fileName, $header, $data) { - $output = array(); + $output = []; $fd = fopen($fileName, 'w'); foreach ($header as $key => $value) {