Clean up code for import routine.

This commit is contained in:
James Cole
2018-03-24 10:35:42 +01:00
parent 310ed9f504
commit 55602d632d
23 changed files with 363 additions and 181 deletions

View File

@@ -25,7 +25,6 @@ namespace FireflyIII\Import\Configuration;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\ImportJob;
use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface;
use FireflyIII\Support\Import\Configuration\Bunq\HasAccounts;
use FireflyIII\Support\Import\Configuration\Bunq\HaveAccounts;
use Log;
@@ -56,6 +55,7 @@ class BunqConfigurator implements ConfiguratorInterface
* @param array $data
*
* @return bool
*
* @throws FireflyException
*/
public function configureJob(array $data): bool
@@ -89,6 +89,7 @@ class BunqConfigurator implements ConfiguratorInterface
* Return the data required for the next step in the job configuration.
*
* @return array
*
* @throws FireflyException
*/
public function getNextData(): array
@@ -116,6 +117,7 @@ class BunqConfigurator implements ConfiguratorInterface
/**
* @return string
*
* @throws FireflyException
*/
public function getNextView(): string
@@ -131,7 +133,6 @@ class BunqConfigurator implements ConfiguratorInterface
return 'import.bunq.accounts';
default:
return '';
}
}
@@ -147,6 +148,7 @@ class BunqConfigurator implements ConfiguratorInterface
/**
* @return bool
*
* @throws FireflyException
*/
public function isJobConfigured(): bool

View File

@@ -61,7 +61,6 @@ class FileConfigurator implements ConfiguratorInterface
/** @var ImportJobRepositoryInterface */
private $repository;
// give job default config:
/** @var string */
private $warning = '';
@@ -145,6 +144,7 @@ class FileConfigurator implements ConfiguratorInterface
* Return possible warning to user.
*
* @return string
*
* @throws FireflyException
*/
public function getWarningMessage(): string
@@ -158,6 +158,7 @@ class FileConfigurator implements ConfiguratorInterface
/**
* @return bool
*
* @throws FireflyException
*/
public function isJobConfigured(): bool
@@ -167,7 +168,7 @@ class FileConfigurator implements ConfiguratorInterface
}
$config = $this->getConfig();
$stage = $config['stage'] ?? 'initial';
if ($stage === 'ready') {
if ('ready' === $stage) {
Log::debug('isJobConfigured returns true');
return true;
@@ -252,6 +253,7 @@ class FileConfigurator implements ConfiguratorInterface
* Shorthand method to return the extended status.
*
* @codeCoverageIgnore
*
* @return array
*/
private function getExtendedStatus(): array

View File

@@ -55,6 +55,7 @@ class SpectreConfigurator implements ConfiguratorInterface
* @param array $data
*
* @return bool
*
* @throws FireflyException
*/
public function configureJob(array $data): bool
@@ -87,6 +88,7 @@ class SpectreConfigurator implements ConfiguratorInterface
* Return the data required for the next step in the job configuration.
*
* @return array
*
* @throws FireflyException
*/
public function getNextData(): array
@@ -124,6 +126,7 @@ class SpectreConfigurator implements ConfiguratorInterface
/**
* @return string
*
* @throws FireflyException
*/
public function getNextView(): string
@@ -143,7 +146,6 @@ class SpectreConfigurator implements ConfiguratorInterface
return 'import.spectre.accounts';
default:
return '';
}
}
@@ -159,6 +161,7 @@ class SpectreConfigurator implements ConfiguratorInterface
/**
* @return bool
*
* @throws FireflyException
*/
public function isJobConfigured(): bool