8000 Little PHPDocs correction · Issue #19821 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Little PHPDocs correction #19821

New issue

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

Closed
EarthDweller opened this issue Sep 2, 2016 · 4 comments
Closed

Little PHPDocs correction #19821

EarthDweller opened this issue Sep 2, 2016 · 4 comments

Comments

@EarthDweller
Copy link
EarthDweller commented Sep 2, 2016

https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/Response.php#L454

Response->setStatusCode() is also used in:

  1. RedirectResponse
  2. JsonResponse
  3. StreamedResponse
  4. BinaryFileResponse

But in PHPDocs written @return Response >> appears some warnings in IDE
Must be:
@return static
or
@return Response|RedirectResponse|JsonResponse|StreamedResponse|BinaryFileResponse

@linaori
Copy link
Contributor
linaori commented Sep 2, 2016

In this case I would say @return $this

@EarthDweller
Copy link
Author
EarthDweller commented Sep 2, 2016

In this case I would say @return $this

Right, RedirectResponse->setStatusCode() can't return BinaryFileResponse

@linaori
Copy link
Contributor
linaori commented Sep 2, 2016

When using return $this in your code, you can add @return $this in your docblock, which is done in other locations as well.

@javiereguiluz
Copy link
Member

Closing it as fixed by #21054.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0