mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 12:12:18 +00:00
Various code cleanup.
This commit is contained in:
@@ -33,6 +33,7 @@ use FireflyIII\Services\Internal\Support\AccountServiceTrait;
|
||||
use FireflyIII\Services\Internal\Support\LocationServiceTrait;
|
||||
use FireflyIII\Services\Internal\Update\AccountUpdateService;
|
||||
use FireflyIII\User;
|
||||
use JsonException;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
@@ -107,6 +108,7 @@ class AccountFactory
|
||||
*
|
||||
* @return Account
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function create(array $data): Account
|
||||
{
|
||||
@@ -180,7 +182,7 @@ class AccountFactory
|
||||
* @param array $data
|
||||
*
|
||||
* @return Account
|
||||
* @throws \JsonException
|
||||
* @throws JsonException
|
||||
*/
|
||||
private function createAccount(AccountType $type, array $data): Account
|
||||
{
|
||||
@@ -247,7 +249,6 @@ class AccountFactory
|
||||
* @param array $data
|
||||
*
|
||||
* @return array
|
||||
* @throws \JsonException
|
||||
*/
|
||||
private function cleanMetaDataArray(Account $account, array $data): array
|
||||
{
|
||||
@@ -358,6 +359,9 @@ class AccountFactory
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param array $data
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
private function storeOrder(Account $account, array $data): void
|
||||
{
|
||||
|
@@ -101,9 +101,7 @@ class RecurrenceFactory
|
||||
if (array_key_exists('active', $data['recurrence'])) {
|
||||
$active = $data['recurrence']['active'];
|
||||
}
|
||||
if (null !== $repeatUntil) {
|
||||
$repeatUntilString = $repeatUntil->format('Y-m-d');
|
||||
}
|
||||
$repeatUntilString = $repeatUntil?->format('Y-m-d');
|
||||
|
||||
$recurrence = new Recurrence(
|
||||
[
|
||||
@@ -111,7 +109,7 @@ class RecurrenceFactory
|
||||
'transaction_type_id' => $type->id,
|
||||
'title' => $title,
|
||||
'description' => $description,
|
||||
'first_date' => $firstDate ? $firstDate->format('Y-m-d') : null,
|
||||
'first_date' => $firstDate?->format('Y-m-d'),
|
||||
'repeat_until' => $repetitions > 0 ? null : $repeatUntilString,
|
||||
'latest_date' => null,
|
||||
'repetitions' => $repetitions,
|
||||
|
@@ -46,6 +46,7 @@ use FireflyIII\Support\NullArrayObject;
|
||||
use FireflyIII\User;
|
||||
use FireflyIII\Validation\AccountValidator;
|
||||
use Illuminate\Support\Collection;
|
||||
use JsonException;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
@@ -146,7 +147,7 @@ class TransactionJournalFactory
|
||||
* @return TransactionJournal|null
|
||||
* @throws DuplicateTransactionException
|
||||
* @throws FireflyException
|
||||
* @throws \JsonException
|
||||
* @throws JsonException
|
||||
*/
|
||||
private function createJournal(NullArrayObject $row): ?TransactionJournal
|
||||
{
|
||||
@@ -295,7 +296,7 @@ class TransactionJournalFactory
|
||||
* @param NullArrayObject $row
|
||||
*
|
||||
* @return string
|
||||
* @throws \JsonException
|
||||
* @throws JsonException
|
||||
*/
|
||||
private function hashArray(NullArrayObject $row): string
|
||||
{
|
||||
@@ -321,7 +322,7 @@ class TransactionJournalFactory
|
||||
* @param string $hash
|
||||
*
|
||||
* @throws DuplicateTransactionException
|
||||
* @throws \JsonException
|
||||
* @throws JsonException
|
||||
*/
|
||||
private function errorIfDuplicate(string $hash): void
|
||||
{
|
||||
|
Reference in New Issue
Block a user