Code cleanup should trigger scan.

This commit is contained in:
James Cole 2022-12-30 20:38:54 +01:00
parent 333c348117
commit 742c84269b
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
12 changed files with 19 additions and 23 deletions

View File

@ -107,17 +107,16 @@ class RecurrenceController extends Controller
$repetition->weekend = (int)$request->get('weekend');
$actualEnd = clone $end;
if('until_date' === $endsAt) {
if ('until_date' === $endsAt) {
$actualEnd = $endDate ?? clone $end;
$occurrences = $this->recurring->getOccurrencesInRange($repetition, $actualStart, $actualEnd);
}
if('times' === $endsAt) {
if ('times' === $endsAt) {
$occurrences = $this->recurring->getXOccurrences($repetition, $actualStart, $repetitions);
}
if('times' !== $endsAt && 'until_date' !== $endsAt) {
if ('times' !== $endsAt && 'until_date' !== $endsAt) {
// 'forever'
$occurrences = $this->recurring->getOccurrencesInRange($repetition, $actualStart, $actualEnd);
}
/** @var Carbon $current */

View File

@ -315,22 +315,22 @@ class RecurrenceFormRequest extends FormRequest
// TODO either use 'withdrawal' or the strtolower() variant, not both.
$type = $this->convertString('transaction_type');
$throwError = true;
if('withdrawal' === $type) {
if ('withdrawal' === $type) {
$throwError = false;
$sourceId = (int)$data['source_id'];
$destinationId = (int)$data['withdrawal_destination_id'];
}
if('deposit' === $type) {
if ('deposit' === $type) {
$throwError = false;
$sourceId = (int)$data['deposit_source_id'];
$destinationId = (int)$data['destination_id'];
}
if('transfer' === $type) {
if ('transfer' === $type) {
$throwError = false;
$sourceId = (int)$data['source_id'];
$destinationId = (int)$data['destination_id'];
}
if(true === $throwError) {
if (true === $throwError) {
throw new FireflyException(sprintf('Cannot handle transaction type "%s"', $this->convertString('transaction_type')));
}

View File

@ -374,7 +374,6 @@ trait RecurringTransactionTrait
$transaction->recurrenceTransactionMeta()->delete();
$transaction->delete();
}
}
}

View File

@ -153,9 +153,7 @@ class CategoryUpdateService
if ('' === $note) {
$dbNote = $category->notes()->first();
if (null !== $dbNote) {
$dbNote->delete();
}
return;