File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,8 @@ public function __invoke(string $slug): BaseHttpResponse|JsonResponse|JsonResour
129129 }
130130
131131 // At this point, $currentPost is guaranteed to be a Post instance
132+ /** @var Post $currentPost */
133+
132134 // Using service method for complex business logic
133135 $ navigationPosts = $ this ->postService ->getNavigationPosts ($ currentPost );
134136
Original file line number Diff line number Diff line change @@ -46,12 +46,8 @@ public function getCustomFilters(array $filters): LengthAwarePaginator
4646 *
4747 * @return array{previous: null|Post, next: null|Post}
4848 */
49- public function getNavigationPosts (? Post $ currentPost ): array
49+ public function getNavigationPosts (Post $ currentPost ): array
5050 {
51- if (!$ currentPost instanceof Post) {
52- throw new \InvalidArgumentException ("Expected a Post instance. " );
53- }
54-
5551 $ currentId = $ currentPost ->id ;
5652
5753 // Get previous post (ID smaller than current, order by ID desc to get the closest one)
You can’t perform that action at this time.
0 commit comments