Fix various phpstan issues.

This commit is contained in:
James Cole
2023-11-04 07:18:03 +01:00
parent dc45131f73
commit ef428a0226
42 changed files with 104 additions and 174 deletions

View File

@@ -266,13 +266,9 @@ class RecurringRepository implements RecurringRepositoryInterface
*/
public function getNoteText(Recurrence $recurrence): string
{
/** @var Note $note */
/** @var Note|null $note */
$note = $recurrence->notes()->first();
if (null !== $note) {
return (string)$note->text;
}
return '';
return (string)$note?->text;
}
/**
@@ -573,12 +569,7 @@ class RecurringRepository implements RecurringRepositoryInterface
/** @var RecurrenceFactory $factory */
$factory = app(RecurrenceFactory::class);
$factory->setUser($this->user);
$result = $factory->create($data);
if (null === $result) {
throw new FireflyException($factory->getErrors()->first());
}
return $result;
return $factory->create($data);
}
/**