Use PSR-12 code style

This commit is contained in:
James Cole
2022-10-30 14:23:00 +01:00
parent b27fe59ab4
commit 1667b88dcd
154 changed files with 277 additions and 322 deletions

View File

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