Skip to content

Commit a56c542

Browse files
committed
fix: PHPStan PostGetNavigateAction
1 parent 4034664 commit a56c542

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Http/Actions/Post/PostGetNavigateAction.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,13 @@ public function __invoke(string $slug): BaseHttpResponse|JsonResponse|JsonResour
115115
->setMessage('Not found');
116116
}
117117

118-
/** @var Post|Builder|Model $currentPost */
119118
$currentPost = Post::query()
120119
->where('id', $slugModel->reference_id)
121120
->where('status', StatusEnum::PUBLISHED)
122121
->with(['categories', 'tags'])
123122
->first();
124123

125-
if (!$currentPost) {
124+
if (!$currentPost || !$currentPost instanceof Post) {
126125
return $this
127126
->httpResponse()
128127
->setError()

0 commit comments

Comments
 (0)