-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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: $request type in BaseController and BaseResource #6910
Conversation
I have a question. What is the |
Typo in PR title : requset -> request |
@samsonasik Fixed. |
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 a fan of the assert()
part. In BaseController
it's not a big problem, but in BaseResource
it can be problematic since I can create my own version without extending the "base" class.
As for RequestInterface
I believe we wanted it to be compatible with PSR-7. But @MGatner is the person to confirm or deny that.
Yes the intent is to have a fully-compatible PSR-7 set of classes. That said, I have no problem with offering our own framework interfaces for people to swap out. I think ideally these are extensions of the PSR-7 versions and classes are typed to what they actually need (i.e. minimum actual methods required) |
@MGatner Will |
The reason I haven't included the |
@kenjis Sorry - what I meant was that I can have my own request class like this:
and use it in my In But in the |
Oh, I didn't expect |
Removed |
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.
Tests are failing, but it's unrelated. Thanks!
To suppress PHPStan error like Call to an undefined method CodeIgniter\HTTP\RequestInterface::getPost()
It seems assert() is not needed to suppress PHPStan errors.
08fbc71
to
738ec56
Compare
I hope we won't need to have a |
Description
To suppress PHPStan errors like:
Related:
Checklist: