We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
get
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?
See above.
3.1.03
8.3
macOS
No response
The text was updated successfully, but these errors were encountered:
For what it's worth, the barryvdh/laravel-ide-helper package does this. Perhaps the source code would be worth reviewing for implementation tips.
Sorry, something went wrong.
ewilan-riviere
No branches or pull requests
What happened?
Suppose I have the following code:
The
get
function type hints that the return value is "string" but it will producelabel?: any
.The docs for this package suggest doing something like this:
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
The text was updated successfully, but these errors were encountered: