Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/DataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Illuminate\Contracts\Support\Jsonable;
use Inertia\DeferProp;
use Inertia\LazyProp;
use Inertia\OptionalProp;
use Inertia\Response;
use ReflectionClass;
use ReflectionMethod;
Expand Down Expand Up @@ -42,7 +43,7 @@
->filter(fn (ReflectionMethod $method) => ! $method->isStatic() && ! in_array($method->name, $this->excludedMethods))
->mapWithKeys(function (ReflectionMethod $method) {
$returnType = $method->getReturnType();
if ($returnType instanceof ReflectionNamedType && in_array($returnType->getName(), [DeferProp::class, LazyProp::class, Closure::class])) {
if ($returnType instanceof ReflectionNamedType && in_array($returnType->getName(), [DeferProp::class, LazyProp::class, OptionalProp::class, Closure::class])) {

Check failure on line 46 in src/DataProvider.php

View workflow job for this annotation

GitHub Actions / phpstan

Fetching class constant class of deprecated class Inertia\LazyProp: Use OptionalProp instead for clearer semantics.
return [$method->name => $method->invoke($this)];
}

Expand Down
Loading