From 334215281efc137e5dde5bcc20e37ed84953409b Mon Sep 17 00:00:00 2001 From: Randall Wilk Date: Tue, 9 Apr 2024 08:42:58 -0500 Subject: [PATCH] Add return types to View component render --- stubs/view-component.stub | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stubs/view-component.stub b/stubs/view-component.stub index f6cecf8..c24b9ce 100644 --- a/stubs/view-component.stub +++ b/stubs/view-component.stub @@ -4,7 +4,9 @@ declare(strict_types=1); namespace {{ namespace }}; +use Closure; use Illuminate\View\Component; +use Illuminate\Contracts\View\View; class {{ class }} extends Component { @@ -12,7 +14,7 @@ class {{ class }} extends Component { } - public function render() + public function render(): View|Closure|string { return {{ view }}; }