Improve code quality.

This commit is contained in:
James Cole
2018-07-22 15:08:56 +02:00
parent d4ba014a8a
commit a941519db5
41 changed files with 210 additions and 52 deletions

View File

@@ -35,10 +35,10 @@ use Log;
*/
class BunqRoutine implements RoutineInterface
{
/** @var ImportJob */
/** @var ImportJob The import job */
private $importJob;
/** @var ImportJobRepositoryInterface */
/** @var ImportJobRepositoryInterface Import job repository */
private $repository;
/**
@@ -63,7 +63,6 @@ class BunqRoutine implements RoutineInterface
$handler = app(StageNewHandler::class);
$handler->setImportJob($this->importJob);
$handler->run();
// make user choose accounts to import from.
$this->repository->setStage($this->importJob, 'choose-accounts');
$this->repository->setStatus($this->importJob, 'need_job_config');
@@ -91,6 +90,8 @@ class BunqRoutine implements RoutineInterface
/**
* Set the import job.
*
* @param ImportJob $importJob
*
* @return void

View File

@@ -36,9 +36,9 @@ use Log;
*/
class FakeRoutine implements RoutineInterface
{
/** @var ImportJob */
/** @var ImportJob The import job */
private $importJob;
/** @var ImportJobRepositoryInterface */
/** @var ImportJobRepositoryInterface Import job repository */
private $repository;
/**
@@ -51,6 +51,9 @@ class FakeRoutine implements RoutineInterface
*
* @return void
* @throws FireflyException
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function run(): void
{
@@ -93,6 +96,8 @@ class FakeRoutine implements RoutineInterface
}
/**
* Set the import job.
*
* @param ImportJob $importJob
*
*/

View File

@@ -33,9 +33,9 @@ use Log;
*/
class FileRoutine implements RoutineInterface
{
/** @var ImportJob */
/** @var ImportJob The import job */
private $importJob;
/** @var ImportJobRepositoryInterface */
/** @var ImportJobRepositoryInterface Import job repository */
private $repository;
/**
@@ -66,6 +66,8 @@ class FileRoutine implements RoutineInterface
}
/**
* Set the import job.
*
* @param ImportJob $importJob
*
* @return void

View File

@@ -40,6 +40,8 @@ interface RoutineInterface
public function run(): void;
/**
* Set the import job.
*
* @param ImportJob $importJob
*
* @return void

View File

@@ -36,10 +36,10 @@ use Log;
class SpectreRoutine implements RoutineInterface
{
/** @var ImportJob */
/** @var ImportJob The import job */
private $importJob;
/** @var ImportJobRepositoryInterface */
/** @var ImportJobRepositoryInterface Import job repository */
private $repository;
/**
@@ -48,6 +48,9 @@ class SpectreRoutine implements RoutineInterface
* The final status of the routine must be "provider_finished".
*
* @throws FireflyException
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function run(): void
{
@@ -108,6 +111,8 @@ class SpectreRoutine implements RoutineInterface
}
/**
* Set the import job.
*
* @param ImportJob $importJob
*
* @return void