Fix various phpstan things

This commit is contained in:
James Cole
2023-11-29 06:30:35 +01:00
parent 1c3cb85a46
commit b9feb0aa71
19 changed files with 77 additions and 78 deletions

View File

@@ -63,11 +63,15 @@ trait UserGroupTrait
* @param Authenticatable|User|null $user
*
* @return void
* @throws FireflyException
*/
public function setUser(Authenticatable | User | null $user): void
{
if ($user instanceof User) {
$this->user = $user;
if(null === $user->userGroup) {
throw new FireflyException(sprintf('User #%d has no user group.', $user->id));
}
$this->userGroup = $user->userGroup;
}
}