/**
* Set metadata for all importable fields in std getfields style format.
+ *
* @param array $importableFieldsMetadata
*/
- public function setImportableFieldsMetadata(array $importableFieldsMetadata) {
+ public function setImportableFieldsMetadata(array $importableFieldsMetadata): void {
$this->importableFieldsMetadata = $importableFieldsMetadata;
}
*
* @return int
*/
- public function setActiveFieldValues($elements, &$erroneousField) {
+ public function setActiveFieldValues($elements, &$erroneousField = NULL) {
$maxCount = count($elements) < $this->_activeFieldCount ? count($elements) : $this->_activeFieldCount;
for ($i = 0; $i < $maxCount; $i++) {
$this->_activeFields[$i]->setValue($elements[$i]);
* @param bool $startImport
* True when progress bar is to be initiated.
* @param $startTimestamp
- * Initial timstamp when the import was started.
+ * Initial timestamp when the import was started.
* @param $prevTimestamp
* Previous timestamp when this function was last called.
* @param $totalRowCount
* @return NULL|$currTimestamp
*/
public function progressImport($statusID, $startImport = TRUE, $startTimestamp = NULL, $prevTimestamp = NULL, $totalRowCount = NULL) {
- $config = CRM_Core_Config::singleton();
- $statusFile = "{$config->uploadDir}status_{$statusID}.txt";
+ $statusFile = CRM_Core_Config::singleton()->uploadDir . "status_{$statusID}.txt";
if ($startImport) {
$status = "<div class='description'> " . ts('No processing status reported yet.') . "</div>";
else {
$rowCount = $this->_rowCount ?? $this->_lineCount;
$currTimestamp = time();
- $totalTime = ($currTimestamp - $startTimestamp);
$time = ($currTimestamp - $prevTimestamp);
$recordsLeft = $totalRowCount - $rowCount;
if ($recordsLeft < 0) {
/**
* @return array
*/
- public function getSelectValues() {
+ public function getSelectValues(): array {
$values = [];
foreach ($this->_fields as $name => $field) {
$values[$name] = $field->_title;
/**
* Determines the file extension based on error code.
*
- * @var $type error code constant
+ * @var int $type error code constant
* @return string
*/
public static function errorFileName($type) {