Refactor some code for recurrences.

This commit is contained in:
James Cole
2019-06-08 06:19:21 +02:00
parent 7c2c24d330
commit 85f9c256a1
21 changed files with 369 additions and 468 deletions

View File

@@ -66,7 +66,6 @@ trait BillServiceTrait
* @param string $note
*
* @return bool
* @throws \Exception
*/
public function updateNote(Bill $bill, string $note): bool
{

View File

@@ -57,7 +57,7 @@ trait RecurringTransactionTrait
[
'recurrence_id' => $recurrence->id,
'repetition_type' => $array['type'],
'repetition_moment' => $array['moment'],
'repetition_moment' => $array['moment'] ?? '',
'repetition_skip' => $array['skip'],
'weekend' => $array['weekend'] ?? 1,
]

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Services\Internal\Support;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Factory\AccountFactory;
use FireflyIII\Factory\TransactionCurrencyFactory;
use FireflyIII\Models\Account;
@@ -75,11 +76,12 @@ trait TransactionServiceTrait
/**
* @param string|null $expectedType
* @param int|null $accountId
* @param Account|null $account
* @param int|null $accountId
* @param string|null $accountName
*
* @return Account|null
* @throws \FireflyIII\Exceptions\FireflyException
* @throws FireflyException
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function findAccount(?string $expectedType, ?Account $account, ?int $accountId, ?string $accountName): ?Account