-
Notifications
You must be signed in to change notification settings - Fork 2k
[DocBlock] Add property $request with @var IncomingRequest in BaseController #4280
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
[DocBlock] Add property $request with @var IncomingRequest in BaseController #4280
Conversation
paulbalandan
left a comment
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.
Agreed. My IDE turns red on incomplete interface reliance.
|
@paulbalandan the another solution is probably add /**
* Instance of the main Request object.
*
* @var RequestInterface&\CodeIgniter\HTTP\IncomingRequest&\CodeIgniter\HTTP\CLIRequest
*/
protected $request;that will always work, what do you think? |
|
But I have an experience with |
|
Yes, PHPStan seems can't verify @var RequestInterface&\CodeIgniter\HTTP\IncomingRequest&\CodeIgniter\HTTP\CLIRequest------ ----------------------------------------------------------------
44 PHPDoc tag @var for property CodeIgniter\Controller::$request
contains unresolvable type. The mark as |
|
This makes me a little uncomfortable with the PSR-7 stuff up in the air, but I think the changes there will require a major version so we could adjust this then anyways. For now I think this will fix a number of other issues for places uses |
|
I don't really have any IDE experience, and you've taught me everything I know about PHPStan. I trust you two to figure this out. 😊 |
|
I'm uncomfortable with a |
|
@paulbalandan Ok, I will merge this 🎉 |
|
Actually, sorry to think about this late, but I think if you run CodeIgniter4/system/CodeIgniter.php Lines 590 to 595 in 363b090
We need to test for this and either update the docblock or revert this change until we can figure this out. |
|
CodeIgniter4/system/Common.php Lines 756 to 759 in 69038f6
|
|
@paulbalandan @samsonasik Please don't let this one slip by |
|
probably |
Hmm. I think this is the way. |
Controller that extends
BaseControllermostly on http, I think it will be better for IDE detection with mark as@var IncomingRequestfor its$requestproperty.Checklist: