Skip to content

Commit

Permalink
Merge pull request #2605 from RaiderIO/development
Browse files Browse the repository at this point in the history
Release v11.6.1 - Updated MDT version to 5.2.5
  • Loading branch information
Wotuu authored Nov 5, 2024
2 parents 62e1b88 + f731a95 commit df36a7b
Show file tree
Hide file tree
Showing 52 changed files with 25,189 additions and 60 deletions.
11 changes: 8 additions & 3 deletions app/Models/Team.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ public function isUserAdmin(User $user): bool
*/
public function isUserCollaborator(User $user): bool
{
return $this->getUserRole($user) !== TeamUser::ROLE_MEMBER;
$userRole = $this->getUserRole($user);
return $userRole !== null && $this->getUserRole($user) !== TeamUser::ROLE_MEMBER;
}

/**
Expand All @@ -276,6 +277,7 @@ public function isUserModerator(User $user): bool
* Checks if a user is a member of this team or not.
*
* @param User|null $user
* @return bool
*/
public function isUserMember(?User $user): bool
{
Expand Down Expand Up @@ -377,9 +379,12 @@ public function getNewAdminUponAdminAccountDeletion(User $user): ?User
}

$roles = TeamUser::ALL_ROLES;
$newOwner = $this->teamusers->where('user_id', '!=', $user->id)->sortByDesc(static fn($obj, $key) => $roles[$obj->role])->first();
/** @var TeamUser|null $newOwner */
$newOwner = $this->teamusers->where('user_id', '!=', $user->id)
->sortByDesc(static fn($obj, $key) => $roles[$obj->role])
->first();

return $newOwner !== null ? $newOwner->user : null;
return $newOwner?->user;
}

public function getAvailableTags(): Collection
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
"type": "package",
"package": {
"name": "nnoggie/mythicdungeontools",
"version": "5.1.7",
"version": "5.2.5",
"source": {
"url": "https://github.com/Wotuu/MythicDungeonTools.git",
"type": "git",
"reference": "45d226753d73bdf17ceeec8bc4937d0e49e644f5"
"reference": "f09f57fcd6dc0a0ffbadb66fa106c5a98831a805"
}
}
},
Expand Down Expand Up @@ -98,7 +98,7 @@
"laravelcollective/html": "^6.4",
"marvinlabs/laravel-discord-logger": "^1.3",
"nnoggie/mdt-legacy": "^1.0",
"nnoggie/mythicdungeontools": "5.1.7",
"nnoggie/mythicdungeontools": "5.2.5",
"paquettg/php-html-parser": "^3.1",
"patreon/patreon": "^1.0.0",
"phlak/semver": "^4.1",
Expand Down
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit df36a7b

Please sign in to comment.