mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-04 04:24:26 +00:00
This fixes the tests (must still upload test database).
This commit is contained in:
@@ -22,10 +22,8 @@ interface ConfiguratorInterface
|
||||
{
|
||||
/**
|
||||
* ConfiguratorInterface constructor.
|
||||
*
|
||||
* @param ImportJob $job
|
||||
*/
|
||||
public function __construct(ImportJob $job);
|
||||
public function __construct();
|
||||
|
||||
/**
|
||||
* Store any data from the $data array into the job.
|
||||
@@ -36,6 +34,13 @@ interface ConfiguratorInterface
|
||||
*/
|
||||
public function configureJob(array $data): bool;
|
||||
|
||||
/**
|
||||
* @param ImportJob $job
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setJob(ImportJob $job);
|
||||
|
||||
/**
|
||||
* Return the data required for the next step in the job configuration.
|
||||
*
|
||||
|
||||
@@ -28,14 +28,11 @@ class CsvConfigurator implements ConfiguratorInterface
|
||||
{
|
||||
private $job;
|
||||
|
||||
public function __construct(ImportJob $job)
|
||||
/**
|
||||
* ConfiguratorInterface constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->job = $job;
|
||||
if (is_null($this->job->configuration) || count($this->job->configuration) === 0) {
|
||||
Log::debug(sprintf('Gave import job %s initial configuration.', $this->job->key));
|
||||
$this->job->configuration = config('csv.default_config');
|
||||
$this->job->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,6 +113,19 @@ class CsvConfigurator implements ConfiguratorInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ImportJob $job
|
||||
*/
|
||||
public function setJob(ImportJob $job)
|
||||
{
|
||||
$this->job = $job;
|
||||
if (is_null($this->job->configuration) || count($this->job->configuration) === 0) {
|
||||
Log::debug(sprintf('Gave import job %s initial configuration.', $this->job->key));
|
||||
$this->job->configuration = config('csv.default_config');
|
||||
$this->job->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws FireflyException
|
||||
|
||||
@@ -37,16 +37,23 @@ class ImportRoutine
|
||||
/**
|
||||
* ImportRoutine constructor.
|
||||
*
|
||||
* @param ImportJob $job
|
||||
*/
|
||||
public function __construct(ImportJob $job)
|
||||
public function __construct()
|
||||
{
|
||||
$this->job = $job;
|
||||
$this->journals = new Collection;
|
||||
$this->errors = new Collection;
|
||||
Log::debug(sprintf('Job ID is #%d', $job->id));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ImportJob $job
|
||||
*/
|
||||
public function setJob(ImportJob $job)
|
||||
{
|
||||
$this->job = $job;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user