Fix phpstan issues.

This commit is contained in:
James Cole
2023-11-05 16:55:16 +01:00
parent 4edd9fe3da
commit a0564751d6
72 changed files with 110 additions and 138 deletions

View File

@@ -104,7 +104,7 @@ class UserGroupRepository implements UserGroupRepositoryInterface
$memberships = $this->user->groupMemberships()->get();
/** @var GroupMembership $membership */
foreach ($memberships as $membership) {
/** @var UserGroup $group */
/** @var UserGroup|null $group */
$group = $membership->userGroup()->first();
if (null !== $group) {
$collection->push($group);
@@ -131,6 +131,7 @@ class UserGroupRepository implements UserGroupRepositoryInterface
$existingGroup = $this->findByName($groupName);
if (null === $existingGroup) {
$exists = false;
/** @var UserGroup|null $existingGroup */
$existingGroup = $this->store(['user' => $user, 'title' => $groupName]);
}
if (null !== $existingGroup) {