Skip to content

Commit

Permalink
manually throw Halt to make phpstan happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy132 committed Dec 2, 2024
1 parent a1eebc1 commit 5356320
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Filament\Forms\Form;
use Filament\Notifications\Notification;
use Filament\Resources\Pages\CreateRecord;
use Filament\Support\Exceptions\Halt;
use Illuminate\Database\Eloquent\Model;
use PDOException;

Expand Down Expand Up @@ -113,7 +114,7 @@ protected function handleRecordCreation(array $data): Model
->danger()
->send();

$this->halt();
throw new Halt();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Filament\Forms\Form;
use Filament\Notifications\Notification;
use Filament\Resources\Pages\EditRecord;
use Filament\Support\Exceptions\Halt;
use Illuminate\Database\Eloquent\Model;
use PDOException;

Expand Down Expand Up @@ -126,7 +127,7 @@ protected function handleRecordUpdate(Model $record, array $data): Model
->danger()
->send();

$this->halt();
throw new Halt();
}
}
}
3 changes: 2 additions & 1 deletion app/Filament/Resources/UserResource/Pages/EditProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use Filament\Forms\Get;
use Filament\Notifications\Notification;
use Filament\Support\Enums\MaxWidth;
use Filament\Support\Exceptions\Halt;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Hash;
Expand Down Expand Up @@ -361,7 +362,7 @@ protected function handleRecordUpdate(Model $record, array $data): Model
->danger()
->send();

$this->halt();
throw new Halt();
}

cache()->forget("users.$record->id.2fa.state");
Expand Down

0 comments on commit 5356320

Please sign in to comment.