Uh oh!
There was an error while loading. Please reload this page.
[DocBlock] Add property $request with @var IncomingRequest in BaseController - #4280
Conversation
paulbalandan
left a comment
There was a problem hiding this comment.
Agreed. My IDE turns red on incomplete interface reliance.
samsonasik
commented
Feb 13, 2021
@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? |
paulbalandan
commented
Feb 13, 2021
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 |
MGatner
commented
Feb 13, 2021
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 |
samsonasik
commented
Feb 13, 2021
MGatner
commented
Feb 13, 2021
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. 😊 |
paulbalandan
commented
Feb 13, 2021
I'm uncomfortable with a |
samsonasik
commented
Feb 13, 2021
samsonasik
commented
Feb 13, 2021
@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. |
MGatner
commented
Feb 13, 2021
CodeIgniter4/system/Common.php Lines 756 to 759 in 69038f6 |
MGatner
commented
Feb 13, 2021
@paulbalandan@samsonasik Please don't let this one slip by |
samsonasik
commented
Feb 13, 2021
probably |
paulbalandan
commented
Feb 13, 2021
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: