Skip to content

Commit

Permalink
Help out phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
lancepioch committed Jul 20, 2023
1 parent abc1ddf commit 2c9ac5a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/Actions/Fortify/UpdateUserProfileInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
/**
* Validate and update the given user's profile information.
*
* @param array<string, string> $input
* @param array<string, mixed> $input
*/
public function update(User $user, array $input): void
{
Expand Down
1 change: 1 addition & 0 deletions app/Actions/Jetstream/CreateTeam.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function create(User $user, array $input): Team
'personal_team' => false,
]));

/** @var Team $team */
return $team;
}
}
3 changes: 2 additions & 1 deletion app/Actions/Jetstream/DeleteUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Models\Team;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Laravel\Jetstream\Contracts\DeletesTeams;
use Laravel\Jetstream\Contracts\DeletesUsers;
Expand Down Expand Up @@ -45,7 +46,7 @@ protected function deleteTeams(User $user): void
{
$user->teams()->detach();

$user->ownedTeams->each(function (Team $team) {
$user->ownedTeams->each(function ($team) {
$this->deletesTeams->delete($team);
});
}
Expand Down
1 change: 1 addition & 0 deletions app/Actions/Jetstream/InviteTeamMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function invite(User $user, Team $team, string $email, string $role = nul

InvitingTeamMember::dispatch($team, $email, $role);

/** @var \App\Models\TeamInvitation $invitation */
$invitation = $team->teamInvitations()->create([
'email' => $email,
'role' => $role,
Expand Down
2 changes: 1 addition & 1 deletion app/Actions/Jetstream/RemoveTeamMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function authorize(User $user, Team $team, User $teamMember): void
*/
protected function ensureUserDoesNotOwnTeam(User $teamMember, Team $team): void
{
if ($teamMember->id === $team->owner->id) {
if ($teamMember->id === $team->owner?->id) {
throw ValidationException::withMessages([
'team' => [__('You may not leave a team that you created.')],
])->errorBag('removeTeamMember');
Expand Down

0 comments on commit 2c9ac5a

Please sign in to comment.