generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
Suppose I have the following code:
protected function label(): Attribute
{
return Attribute::make(
get: fn (): string => 'Some label',
);
}The get function type hints that the return value is "string" but it will produce label?: any.
The docs for this package suggest doing something like this:
/**
* @return string
*/
protected function label(): Attribute
{
return Attribute::make(
get: fn (): string => 'Some label',
);
}But that confused my IDE because the PHPDoc doesn't match the function return type.
Is it possible to parse the return type from the Attribute's get closure?
How to reproduce the bug
See above.
Package Version
3.1.03
PHP Version
8.3
Which operating systems does with happen with?
macOS
Notes
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working