mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-17 09:51:40 +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.
|
* Returns the journals created for this recurrence, possibly limited by time.
|
||||||
*
|
*
|
||||||
* @param Recurrence $recurrence
|
* @param Recurrence $recurrence
|
||||||
* @param Carbon|null $start
|
* @param Carbon|null $start
|
||||||
* @param Carbon|null $end
|
* @param Carbon|null $end
|
||||||
*
|
*
|
||||||
@@ -209,30 +209,12 @@ class RecurringRepository implements RecurringRepositoryInterface
|
|||||||
return '';
|
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.
|
* Generate events in the date range.
|
||||||
*
|
*
|
||||||
* @param RecurrenceRepetition $repetition
|
* @param RecurrenceRepetition $repetition
|
||||||
* @param Carbon $start
|
* @param Carbon $start
|
||||||
* @param Carbon $end
|
* @param Carbon $end
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
@@ -269,6 +251,26 @@ class RecurringRepository implements RecurringRepositoryInterface
|
|||||||
return $occurrences;
|
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.
|
* Get the tags from the recurring transaction.
|
||||||
*
|
*
|
||||||
@@ -291,8 +293,8 @@ class RecurringRepository implements RecurringRepositoryInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Recurrence $recurrence
|
* @param Recurrence $recurrence
|
||||||
* @param int $page
|
* @param int $page
|
||||||
* @param int $pageSize
|
* @param int $pageSize
|
||||||
*
|
*
|
||||||
* @return LengthAwarePaginator
|
* @return LengthAwarePaginator
|
||||||
*/
|
*/
|
||||||
@@ -336,14 +338,12 @@ class RecurringRepository implements RecurringRepositoryInterface
|
|||||||
->get()->pluck('transaction_journal_id')->toArray();
|
->get()->pluck('transaction_journal_id')->toArray();
|
||||||
$search = [];
|
$search = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach ($journalMeta as $journalId) {
|
foreach ($journalMeta as $journalId) {
|
||||||
$search[] = (int)$journalId;
|
$search[] = (int)$journalId;
|
||||||
}
|
}
|
||||||
if (0 === count($search)) {
|
if (0 === count($search)) {
|
||||||
|
|
||||||
return [];
|
return new Collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var GroupCollectorInterface $collector */
|
/** @var GroupCollectorInterface $collector */
|
||||||
@@ -361,11 +361,11 @@ class RecurringRepository implements RecurringRepositoryInterface
|
|||||||
* Calculate the next X iterations starting on the date given in $date.
|
* Calculate the next X iterations starting on the date given in $date.
|
||||||
*
|
*
|
||||||
* @param RecurrenceRepetition $repetition
|
* @param RecurrenceRepetition $repetition
|
||||||
* @param Carbon $date
|
* @param Carbon $date
|
||||||
* @param int $count
|
* @param int $count
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function getXOccurrences(RecurrenceRepetition $repetition, Carbon $date, int $count): array
|
public function getXOccurrences(RecurrenceRepetition $repetition, Carbon $date, int $count): array
|
||||||
{
|
{
|
||||||
@@ -399,7 +399,7 @@ class RecurringRepository implements RecurringRepositoryInterface
|
|||||||
* @param RecurrenceRepetition $repetition
|
* @param RecurrenceRepetition $repetition
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function repetitionDescription(RecurrenceRepetition $repetition): string
|
public function repetitionDescription(RecurrenceRepetition $repetition): string
|
||||||
{
|
{
|
||||||
@@ -472,7 +472,7 @@ class RecurringRepository implements RecurringRepositoryInterface
|
|||||||
* Update a recurring transaction.
|
* Update a recurring transaction.
|
||||||
*
|
*
|
||||||
* @param Recurrence $recurrence
|
* @param Recurrence $recurrence
|
||||||
* @param array $data
|
* @param array $data
|
||||||
*
|
*
|
||||||
* @return Recurrence
|
* @return Recurrence
|
||||||
* @throws FireflyException
|
* @throws FireflyException
|
||||||
|
Reference in New Issue
Block a user