Rearrange code [skip ci]

This commit is contained in:
James Cole
2016-12-14 18:59:12 +01:00
parent f19b99194c
commit 848cfabcba
45 changed files with 321 additions and 319 deletions

View File

@@ -41,7 +41,7 @@ class ReportFormRequest extends Request
/**
* @return Collection
*/
public function getAccountList():Collection
public function getAccountList(): Collection
{
/** @var AccountRepositoryInterface $repository */
$repository = app(AccountRepositoryInterface::class);
@@ -59,27 +59,6 @@ class ReportFormRequest extends Request
return $collection;
}
/**
* @return Collection
*/
public function getCategoryList(): Collection
{
/** @var CategoryRepositoryInterface $repository */
$repository = app(CategoryRepositoryInterface::class);
$set = $this->get('category');
$collection = new Collection;
if (is_array($set)) {
foreach ($set as $categoryId) {
$category = $repository->find(intval($categoryId));
if (!is_null($category->id)) {
$collection->push($category);
}
}
}
return $collection;
}
/**
* @return Collection
*/
@@ -101,6 +80,27 @@ class ReportFormRequest extends Request
return $collection;
}
/**
* @return Collection
*/
public function getCategoryList(): Collection
{
/** @var CategoryRepositoryInterface $repository */
$repository = app(CategoryRepositoryInterface::class);
$set = $this->get('category');
$collection = new Collection;
if (is_array($set)) {
foreach ($set as $categoryId) {
$category = $repository->find(intval($categoryId));
if (!is_null($category->id)) {
$collection->push($category);
}
}
}
return $collection;
}
/**
* @return Carbon
* @throws FireflyException