Code cleanup and tests.

This commit is contained in:
James Cole
2017-07-23 08:32:51 +02:00
parent 8bb7d5de3f
commit f85ab74e2b
15 changed files with 72 additions and 90 deletions

View File

@@ -180,8 +180,8 @@ class ImportBill
Log::debug('Finding a mapped bill based on', $array);
$search = intval($array['mapped']);
$bill = $this->repository->find($search);
$search = intval($array['mapped']);
$bill = $this->repository->find($search);
if (is_null($bill->id)) {
Log::error(sprintf('There is no bill with id #%d. Invalid mapping will be ignored!', $search));

View File

@@ -180,7 +180,7 @@ class ImportBudget
Log::debug('Finding a mapped budget based on', $array);
$search = intval($array['mapped']);
$search = intval($array['mapped']);
$budget = $this->repository->find($search);
if (is_null($budget->id)) {

View File

@@ -174,7 +174,7 @@ class ImportCategory
Log::debug('Finding a mapped category based on', $array);
$search = intval($array['mapped']);
$search = intval($array['mapped']);
$category = $this->repository->find($search);
if (is_null($category->id)) {

View File

@@ -65,19 +65,6 @@ class ImportJournal
/** @var User */
private $user;
/**
* @return string
*/
public function getDescription(): string
{
if ($this->description === '') {
return '(no description)';
}
return $this->description;
}
/**
* ImportEntry constructor.
*/
@@ -157,6 +144,18 @@ class ImportJournal
return $date;
}
/**
* @return string
*/
public function getDescription(): string
{
if ($this->description === '') {
return '(no description)';
}
return $this->description;
}
/**
* @param string $hash
*/