Is it possible to change a type of method parameter in extensions? #6850
-
Hi, I'm trying to solve a problem in Larastan. In Laravel's Eloquent builder class there are some methods that checks the existence of relations and allows you to pass a closure to further modify the query. For example Post::query()->whereHas('comments', function (Builder $query): void {
$query->where('content', 'like', 'code%');
}); The closure passed in the second argument, would create a SQL query that works on the And /**
* @param string $relation
* @param (\Closure(static): void) $callback
* / From the previous example, return type of But like I explained before, in runtime that So there is my question. Is it possible to change the type of Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Exactly, this is the only chance to do that :( I think this looks like a similar problem to larastan/larastan#1110 so maybe it should cover that too. |
Beta Was this translation helpful? Give feedback.
-
Is this not possible with a |
Beta Was this translation helpful? Give feedback.
Exactly, this is the only chance to do that :(
I think this looks like a similar problem to larastan/larastan#1110 so maybe it should cover that too.