mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Use PSR-12 code style
This commit is contained in:
@@ -42,7 +42,8 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
class GenericRequest extends FormRequest
|
||||
{
|
||||
use ConvertsDataTypes, ChecksLogin;
|
||||
use ConvertsDataTypes;
|
||||
use ChecksLogin;
|
||||
|
||||
private Collection $accounts;
|
||||
private Collection $bills;
|
||||
@@ -69,11 +70,11 @@ class GenericRequest extends FormRequest
|
||||
public function getAssetAccounts(): Collection
|
||||
{
|
||||
$this->parseAccounts();
|
||||
$return = new Collection;
|
||||
$return = new Collection();
|
||||
/** @var Account $account */
|
||||
foreach ($this->accounts as $account) {
|
||||
$type = $account->accountType->type;
|
||||
if (in_array($type, [AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE])) {
|
||||
if (in_array($type, [AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE], true)) {
|
||||
$return->push($account);
|
||||
}
|
||||
}
|
||||
@@ -216,7 +217,7 @@ class GenericRequest extends FormRequest
|
||||
public function getExpenseAccounts(): Collection
|
||||
{
|
||||
$this->parseAccounts();
|
||||
$return = new Collection;
|
||||
$return = new Collection();
|
||||
/** @var Account $account */
|
||||
foreach ($this->accounts as $account) {
|
||||
$type = $account->accountType->type;
|
||||
@@ -234,7 +235,7 @@ class GenericRequest extends FormRequest
|
||||
public function getRevenueAccounts(): Collection
|
||||
{
|
||||
$this->parseAccounts();
|
||||
$return = new Collection;
|
||||
$return = new Collection();
|
||||
/** @var Account $account */
|
||||
foreach ($this->accounts as $account) {
|
||||
$type = $account->accountType->type;
|
||||
@@ -297,11 +298,11 @@ class GenericRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
// this is cheating but it works to initialize the collections.
|
||||
$this->accounts = new Collection;
|
||||
$this->budgets = new Collection;
|
||||
$this->categories = new Collection;
|
||||
$this->bills = new Collection;
|
||||
$this->tags = new Collection;
|
||||
$this->accounts = new Collection();
|
||||
$this->budgets = new Collection();
|
||||
$this->categories = new Collection();
|
||||
$this->bills = new Collection();
|
||||
$this->tags = new Collection();
|
||||
|
||||
return [
|
||||
'start' => 'required|date',
|
||||
|
Reference in New Issue
Block a user