/**
* 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;
}
* @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;