mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-16 14:48:11 +00:00
Rearrange code [skip ci]
This commit is contained in:
@@ -80,7 +80,7 @@ class AccountFormRequest extends Request
|
||||
'name' => $nameRule,
|
||||
'openingBalance' => 'numeric',
|
||||
'iban' => 'iban',
|
||||
'BIC' => 'bic',
|
||||
'BIC' => 'bic',
|
||||
'virtualBalance' => 'numeric',
|
||||
'openingBalanceDate' => 'date',
|
||||
'currency_id' => 'exists:transaction_currencies,id',
|
||||
|
||||
@@ -161,6 +161,7 @@ class JournalFormRequest extends Request
|
||||
private function getFieldOrEmptyString(string $field): string
|
||||
{
|
||||
$string = $this->get($field) ?? '';
|
||||
|
||||
return trim($string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -35,7 +35,7 @@ class TagFormRequest extends Request
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function collectTagData() :array
|
||||
public function collectTagData(): array
|
||||
{
|
||||
if ($this->get('setTag') == 'true') {
|
||||
$latitude = $this->get('latitude');
|
||||
|
||||
Reference in New Issue
Block a user