Can we have an additional option to declare response in doc-block? #598
-
Beta Was this translation helpful? Give feedback.
Answered by
romalytvynenko
Oct 25, 2024
Replies: 1 comment 1 reply
-
@mikield I planned to move to using attributes for responses instead of PHPDoc annotations. Types will be passed to the attribute as a string: #[Response(body: 'AnonymousResourceCollection<TodoItemResource>', status: 200)]
public function index()
{
// ...
} I planned to do such types parsing strict: in case the class is not imported, Scramble will throw the error. This, however, still does not solve the issue you're raising. I quickly scanned through the PhpStorm meta documentation, but have not found how to make PhpStorm recognized strings passed to |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mikield
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@mikield I planned to move to using attributes for responses instead of PHPDoc annotations.
Types will be passed to the attribute as a string:
I planned to do such types parsing strict: in case the class is not imported, Scramble will throw the error.
This, however, still does not solve the issue you're raising. I quickly scanned through the PhpStorm meta documentation, but have not found how to make PhpStorm recognized strings passed to
$body
parameter as class names. If you can look at that, I'd appreciate it!