mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-06 04:34:00 +00:00
Rearrange code [skip ci]
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user