Skip to content

Update @return type of toResponse() to mixed for accuracy#645

Merged
taylorotwell merged 5 commits intolaravel:1.xfrom
mohammadRezaei1380:SimpleViewResponse_mixed
Feb 19, 2026
Merged

Update @return type of toResponse() to mixed for accuracy#645
taylorotwell merged 5 commits intolaravel:1.xfrom
mohammadRezaei1380:SimpleViewResponse_mixed

Conversation

@mohammadRezaei1380
Copy link
Contributor

The previous PHPDoc declared the return type as Symfony\Component\HttpFoundation\Response,
however the method may return different response types depending on the configured view callback.

Since the callback can return a View instance, a Response, a RedirectResponse,
a JsonResponse, a Responsable implementation, or other types, mixed more accurately
reflects the actual behavior of the method.

This change does not modify runtime behavior — it only improves documentation accuracy.

@taylorotwell taylorotwell merged commit 5f11482 into laravel:1.x Feb 19, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments