-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Request::getClientIp returns null when running in cli mode #22415
Comments
While this is true what is the point in asking for the client IP on the CLI where there is no HTTP request at all? |
I discovered the bug when a middleware calling this was added into the application stack and called in unit tests, and failed unexpectedly by throwing TypeError because I passed the result directly into a string argument. |
The only thing we can do is to relax the return type in the docblock as there is no IP address we could return. So that would not really solve your issue. |
If the return type is correct I would have already handled the null case accordingly, so please modify the doc to reflect the reality.
Get Outlook for Android<https://aka.ms/ghei36>
…________________________________
From: Christian Flothmann <notifications@github.com>
Sent: Thursday, April 13, 2017 6:07:39 PM
To: symfony/symfony
Cc: Michael Tsang; Author
Subject: Re: [symfony/symfony] Request::getClientIp returns null when running in cli mode (#22415)
The only thing we can do is to relax the return type in the docblock as there is no IP address we could return. So that would not really solve your issue.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#22415 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ACskACITfifuQ1rl-Joc1x4DYtBqVYYSks5rvfPrgaJpZM4M8YX4>.
|
This PR was merged into the 2.7 branch. Discussion ---------- [HttpFoundation] Fix getClientIp @return docblock | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #22415 | License | MIT | Doc PR | none Commits ------- af3424f [HttpFoundation] Fix getClientIp @return docblock
Running
from cli gets null which violates the PHPDoc saying it return string.
The text was updated successfully, but these errors were encountered: