-
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
IncomingRequest property $uri is public and should be protected #5344
Comments
$uri
is public and should (?) be protected
$uri
is public and should (?) be protected
Thank you! Probably it seems I sent a PR #5345 for now. |
Ref #3230 |
Yes as @kenjis pointed out we are stuck with this for now for backwards-compatibility but very much would like it changed. Version 5 already has plans on refactoring the HTTP layer to be PSR-compliant so that will address this. Safe to close this issue. |
We deprecated $uri in v4.3.0. #6662
|
Closed by #8067 |
PHP Version
8.0
CodeIgniter4 Version
4.1.5
Which operating systems have you tested for this bug?
Linux
Which server did you use?
apache
Database
No response
What happened?
It's not a bug, but an inconsistency. Class
Request
have property$uri
which is protected, butIncomingRequest
class change this access level to public. It's should be protected also, especially that there isgetUri()
method to get it. Unfortunetly I don't see this method in CodeIniter documentation. This is why I assume that most of people get this by property name, not method (as I done it first), so changing it can couse problems in projects.Steps to Reproduce
In eg. Controller usage of
$this->request->uri
Should not be available. Should use this:$this->request->getUri()
Expected Output
$this->request->uri
Cannot access protected property CodeIgniter\HTTP\IncomingRequest::$uri
Anything else?
No response
The text was updated successfully, but these errors were encountered: