Code cleanup [skip ci]

This commit is contained in:
James Cole
2018-06-06 21:23:00 +02:00
parent 20044427b4
commit 4a12d4d156
75 changed files with 319 additions and 341 deletions

View File

@@ -360,6 +360,7 @@ class ImportJobRepository implements ImportJobRepositoryInterface
$newConfig = array_merge($currentConfig, $configuration);
$job->configuration = $newConfig;
$job->save();
//Log::debug(sprintf('Set config of job "%s" to: ', $job->key), $newConfig);
return $job;

View File

@@ -36,52 +36,13 @@ use Symfony\Component\HttpFoundation\File\UploadedFile;
interface ImportJobRepositoryInterface
{
/**
* Return all attachments for job.
*
* @param ImportJob $job
*
* @return Collection
*/
public function getAttachments(ImportJob $job): Collection;
/**
* Handle upload for job.
*
* @param ImportJob $job
* @param string $name
* @param UploadedFile $file
*
* @return MessageBag
* @throws FireflyException
*/
public function storeFileUpload(ImportJob $job, string $name, UploadedFile $file): MessageBag;
/**
* Store file.
*
* @param ImportJob $job
* @param string $name
* @param string $fileName
*
* @return MessageBag
*/
public function storeCLIUpload(ImportJob $job, string $name, string $fileName): MessageBag;
/**
* @param ImportJob $job
* @param array $transactions
* @param int $index
* @param string $error
*
* @return ImportJob
*/
public function setTransactions(ImportJob $job, array $transactions): ImportJob;
/**
* @param ImportJob $job
* @param Tag $tag
*
* @return ImportJob
*/
public function setTag(ImportJob $job, Tag $tag): ImportJob;
public function addError(ImportJob $job, int $index, string $error): ImportJob;
/**
* Add message to job.
@@ -93,15 +54,6 @@ interface ImportJobRepositoryInterface
*/
public function addErrorMessage(ImportJob $job, string $error): ImportJob;
/**
* @param ImportJob $job
* @param int $index
* @param string $error
*
* @return ImportJob
*/
public function addError(ImportJob $job, int $index, string $error): ImportJob;
/**
* @param ImportJob $job
* @param int $steps
@@ -141,6 +93,15 @@ interface ImportJobRepositoryInterface
*/
public function findByKey(string $key): ImportJob;
/**
* Return all attachments for job.
*
* @param ImportJob $job
*
* @return Collection
*/
public function getAttachments(ImportJob $job): Collection;
/**
* Return configuration of job.
*
@@ -198,14 +159,6 @@ interface ImportJobRepositoryInterface
*/
public function setExtendedStatus(ImportJob $job, array $array): ImportJob;
/**
* @param ImportJob $job
* @param string $status
*
* @return ImportJob
*/
public function setStatus(ImportJob $job, string $status): ImportJob;
/**
* @param ImportJob $job
* @param string $stage
@@ -214,6 +167,14 @@ interface ImportJobRepositoryInterface
*/
public function setStage(ImportJob $job, string $stage): ImportJob;
/**
* @param ImportJob $job
* @param string $status
*
* @return ImportJob
*/
public function setStatus(ImportJob $job, string $status): ImportJob;
/**
* @param ImportJob $job
* @param int $steps
@@ -222,6 +183,14 @@ interface ImportJobRepositoryInterface
*/
public function setStepsDone(ImportJob $job, int $steps): ImportJob;
/**
* @param ImportJob $job
* @param Tag $tag
*
* @return ImportJob
*/
public function setTag(ImportJob $job, Tag $tag): ImportJob;
/**
* @param ImportJob $job
* @param int $count
@@ -230,11 +199,42 @@ interface ImportJobRepositoryInterface
*/
public function setTotalSteps(ImportJob $job, int $count): ImportJob;
/**
* @param ImportJob $job
* @param array $transactions
*
* @return ImportJob
*/
public function setTransactions(ImportJob $job, array $transactions): ImportJob;
/**
* @param User $user
*/
public function setUser(User $user);
/**
* Store file.
*
* @param ImportJob $job
* @param string $name
* @param string $fileName
*
* @return MessageBag
*/
public function storeCLIUpload(ImportJob $job, string $name, string $fileName): MessageBag;
/**
* Handle upload for job.
*
* @param ImportJob $job
* @param string $name
* @param UploadedFile $file
*
* @return MessageBag
* @throws FireflyException
*/
public function storeFileUpload(ImportJob $job, string $name, UploadedFile $file): MessageBag;
/**
* @param ImportJob $job
* @param string $status