Skip to content

IncomingRequest property $uri is public and should be protected #5344

@pawelkg

Description

@pawelkg

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, but IncomingRequest class change this access level to public. It's should be protected also, especially that there is getUri() 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changePull requests that may break existing functionalitiesbugVerified issues on the current code behavior or pull requests that will fix themnext major version?Read this for a relevant v5 idea

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions