-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: CodeIgniter::run() doesn't respect $returnResponse #6737
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
fix: CodeIgniter::run() doesn't respect $returnResponse #6737
Conversation
if ($this->returnRespose) { | ||
return $this->response; | ||
} | ||
|
||
$this->sendResponse(); | ||
|
||
$this->callExit(EXIT_SUCCESS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR, but is this callExit()
necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure - maybe just to enforce a "never return" condition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you will add @phpstan-return never
to protected function callExit
, then phpstan correctly flags that the return;
below will not be reached. So, this must be a bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the return
is there because MockCodeIgniter prevents the actual exit statement. Still, this is a bad set up, and we should probably get rid of the exit altogether and just have the whole stack return cleanly.
Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
54b9d3a
to
59c076f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see if @AmitSonkhiya can test this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, I would like to see another tester if anyone is up for it.
Description
Fixes #6650
Checklist: