File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 44
55namespace Webfox \InertiaDataProviders ;
66
7+ use ReflectionNamedType ;
78use Illuminate \Contracts \Support \Arrayable ;
89use Inertia \LazyProp ;
910use ReflectionClass ;
@@ -33,8 +34,9 @@ public function toArray(): array
3334 ->filter (fn (ReflectionMethod $ method ) => ! $ method ->isStatic ())
3435 ->filter (fn (ReflectionMethod $ method ) => ! $ method ->isStatic () && ! in_array ($ method ->name , ['toArray ' , '__construct ' ]))
3536 ->mapWithKeys (function (ReflectionMethod $ method ) {
37+ $ returnType = $ method ->getReturnType ();
3638 // @phpstan-ignore-next-line
37- if ($ method -> getReturnType ()? ->getName() === LazyProp::class) {
39+ if ($ returnType instanceof ReflectionNamedType && $ returnType ->getName () === LazyProp::class) {
3840 return [$ method ->name => $ method ->invoke ($ this )];
3941 }
4042
You can’t perform that action at this time.
0 commit comments