Code cleanup.

This commit is contained in:
James Cole
2021-03-28 11:39:26 +02:00
parent 6401b5c9eb
commit 5abbb8a807
155 changed files with 651 additions and 499 deletions

View File

@@ -72,7 +72,6 @@ class UpdateRequest extends FormRequest
$models = implode(',', $models);
$model = $this->string('attachable_type');
return [
'filename' => 'between:1,255',
'title' => 'between:1,255',

View File

@@ -96,6 +96,4 @@ class Request extends FormRequest
}
);
}
}

View File

@@ -43,12 +43,10 @@ class StoreRequest extends FormRequest
*/
public function getAll(): array
{
$fields = [
$fields = [
'order' => ['order', 'integer'],
];
$data = $this->getAllData($fields);
$data = $this->getAllData($fields);
$data['name'] = $this->string('name');
$data['account_id'] = $this->integer('account_id');
$data['targetamount'] = $this->string('target_amount');

View File

@@ -42,7 +42,6 @@ class StoreRequest extends FormRequest
{
use ConvertsDataTypes, RecurrenceValidation, TransactionValidation, CurrencyValidation, GetRecurrenceData, ChecksLogin;
/**
* Get all data from the request.
*
@@ -171,8 +170,6 @@ class StoreRequest extends FormRequest
'transactions.*.piggy_bank_id' => ['numeric', 'mustExist:piggy_banks,id', new BelongsUser],
'transactions.*.piggy_bank_name' => ['between:1,255', 'nullable', new BelongsUser],
'transactions.*.tags' => 'between:1,64000',
];
}

View File

@@ -42,7 +42,6 @@ class UpdateRequest extends FormRequest
{
use ConvertsDataTypes, RecurrenceValidation, TransactionValidation, CurrencyValidation, GetRecurrenceData, ChecksLogin;
/**
* Get all data from the request.
*

View File

@@ -31,7 +31,6 @@ use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
use function is_array;
/**
* Class StoreRequest
*/
@@ -39,7 +38,6 @@ class StoreRequest extends FormRequest
{
use ConvertsDataTypes, GetRuleConfiguration, ChecksLogin;
/**
* Get all data from the request.
*

View File

@@ -24,7 +24,6 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Requests\Models\Rule;
use Carbon\Carbon;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
@@ -37,7 +36,6 @@ class TestRequest extends FormRequest
{
use ConvertsDataTypes, ChecksLogin;
/**
* @return array
*/

View File

@@ -24,7 +24,6 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Requests\Models\Rule;
use Carbon\Carbon;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
@@ -37,7 +36,6 @@ class TriggerRequest extends FormRequest
{
use ConvertsDataTypes, ChecksLogin;
/**
* @return array
*/

View File

@@ -31,7 +31,6 @@ use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
use function is_array;
/**
* Class UpdateRequest
*/

View File

@@ -28,7 +28,6 @@ use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
/**
* @codeCoverageIgnore
* Class StoreRequest

View File

@@ -24,7 +24,6 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Requests\Models\RuleGroup;
use Carbon\Carbon;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
@@ -37,7 +36,6 @@ class TestRequest extends FormRequest
{
use ConvertsDataTypes, ChecksLogin;
/**
* @return array
*/

View File

@@ -24,7 +24,6 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Requests\Models\RuleGroup;
use Carbon\Carbon;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
@@ -37,7 +36,6 @@ class TriggerRequest extends FormRequest
{
use ConvertsDataTypes, ChecksLogin;
/**
* @return array
*/

View File

@@ -28,7 +28,6 @@ use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
/**
* @codeCoverageIgnore
* Class UpdateRequest

View File

@@ -39,7 +39,6 @@ class UpdateRequest extends FormRequest
{
use ConvertsDataTypes, ChecksLogin, AppendsLocationData;
/**
* Get all data from the request.
*

View File

@@ -147,8 +147,6 @@ class StoreRequest extends FormRequest
'sepa_ep' => $this->stringFromValue($object['sepa_ep']),
'sepa_ci' => $this->stringFromValue($object['sepa_ci']),
'sepa_batch_id' => $this->stringFromValue($object['sepa_batch_id']),
// custom date fields. Must be Carbon objects. Presence is optional.
'interest_date' => $this->dateFromValue($object['interest_date']),
'book_date' => $this->dateFromValue($object['book_date']),
@@ -250,8 +248,6 @@ class StoreRequest extends FormRequest
'transactions.*.payment_date' => 'date|nullable',
'transactions.*.invoice_date' => 'date|nullable',
];
}
/**

View File

@@ -28,7 +28,6 @@ use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
/**
* Class StoreRequest
*

View File

@@ -28,7 +28,6 @@ use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
/**
* Class UpdateRequest
*

View File

@@ -48,8 +48,6 @@ class StoreRequest extends FormRequest
'outward' => $this->string('outward'),
'inward' => $this->string('inward'),
];
}
/**

View File

@@ -49,8 +49,6 @@ class UpdateRequest extends FormRequest
'outward' => $this->string('outward'),
'inward' => $this->string('inward'),
];
}
/**

View File

@@ -1,5 +1,4 @@
<?php
/*
* CreateRequest.php
* Copyright (c) 2021 james@firefly-iii.org
@@ -21,25 +20,6 @@
*/
declare(strict_types=1);
/*
* CreateRequest.php
* Copyright (c) 2020 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace FireflyIII\Api\V1\Requests\Models\Webhook;

View File

@@ -1,5 +1,4 @@
<?php
/*
* UpdateRequest.php
* Copyright (c) 2021 james@firefly-iii.org
@@ -21,25 +20,6 @@
*/
declare(strict_types=1);
/*
* UpdateRequest.php
* Copyright (c) 2020 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace FireflyIII\Api\V1\Requests\Models\Webhook;