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

@@ -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',

View File

@@ -161,6 +161,7 @@ class JournalFormRequest extends Request
private function getFieldOrEmptyString(string $field): string
{
$string = $this->get($field) ?? '';
return trim($string);
}
}

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

View File

@@ -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');