mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 01:06:46 +00:00
Fix return type #2440
This commit is contained in:
@@ -151,7 +151,7 @@ class RecurringRepository implements RecurringRepositoryInterface
|
||||
/**
|
||||
* Returns the journals created for this recurrence, possibly limited by time.
|
||||
*
|
||||
* @param Recurrence $recurrence
|
||||
* @param Recurrence $recurrence
|
||||
* @param Carbon|null $start
|
||||
* @param Carbon|null $end
|
||||
*
|
||||
@@ -209,30 +209,12 @@ class RecurringRepository implements RecurringRepositoryInterface
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Recurrence $recurrence
|
||||
* @return PiggyBank|null
|
||||
*/
|
||||
public function getPiggyBank(Recurrence $recurrence): ?PiggyBank
|
||||
{
|
||||
$meta = $recurrence->recurrenceMeta;
|
||||
/** @var RecurrenceMeta $metaEntry */
|
||||
foreach ($meta as $metaEntry) {
|
||||
if ('piggy_bank_id' === $metaEntry->name) {
|
||||
$piggyId = (int)$metaEntry->value;
|
||||
return $this->user->piggyBanks()->where('piggy_banks.id', $piggyId)->first(['piggy_banks.*']);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate events in the date range.
|
||||
*
|
||||
* @param RecurrenceRepetition $repetition
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
@@ -269,6 +251,26 @@ class RecurringRepository implements RecurringRepositoryInterface
|
||||
return $occurrences;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Recurrence $recurrence
|
||||
*
|
||||
* @return PiggyBank|null
|
||||
*/
|
||||
public function getPiggyBank(Recurrence $recurrence): ?PiggyBank
|
||||
{
|
||||
$meta = $recurrence->recurrenceMeta;
|
||||
/** @var RecurrenceMeta $metaEntry */
|
||||
foreach ($meta as $metaEntry) {
|
||||
if ('piggy_bank_id' === $metaEntry->name) {
|
||||
$piggyId = (int)$metaEntry->value;
|
||||
|
||||
return $this->user->piggyBanks()->where('piggy_banks.id', $piggyId)->first(['piggy_banks.*']);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tags from the recurring transaction.
|
||||
*
|
||||
@@ -291,8 +293,8 @@ class RecurringRepository implements RecurringRepositoryInterface
|
||||
|
||||
/**
|
||||
* @param Recurrence $recurrence
|
||||
* @param int $page
|
||||
* @param int $pageSize
|
||||
* @param int $page
|
||||
* @param int $pageSize
|
||||
*
|
||||
* @return LengthAwarePaginator
|
||||
*/
|
||||
@@ -336,14 +338,12 @@ class RecurringRepository implements RecurringRepositoryInterface
|
||||
->get()->pluck('transaction_journal_id')->toArray();
|
||||
$search = [];
|
||||
|
||||
|
||||
|
||||
foreach ($journalMeta as $journalId) {
|
||||
$search[] = (int)$journalId;
|
||||
}
|
||||
if (0 === count($search)) {
|
||||
|
||||
return [];
|
||||
return new Collection;
|
||||
}
|
||||
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
@@ -361,11 +361,11 @@ class RecurringRepository implements RecurringRepositoryInterface
|
||||
* Calculate the next X iterations starting on the date given in $date.
|
||||
*
|
||||
* @param RecurrenceRepetition $repetition
|
||||
* @param Carbon $date
|
||||
* @param int $count
|
||||
* @param Carbon $date
|
||||
* @param int $count
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function getXOccurrences(RecurrenceRepetition $repetition, Carbon $date, int $count): array
|
||||
{
|
||||
@@ -399,7 +399,7 @@ class RecurringRepository implements RecurringRepositoryInterface
|
||||
* @param RecurrenceRepetition $repetition
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function repetitionDescription(RecurrenceRepetition $repetition): string
|
||||
{
|
||||
@@ -472,7 +472,7 @@ class RecurringRepository implements RecurringRepositoryInterface
|
||||
* Update a recurring transaction.
|
||||
*
|
||||
* @param Recurrence $recurrence
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
*
|
||||
* @return Recurrence
|
||||
* @throws FireflyException
|
||||
|
Reference in New Issue
Block a user