Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

\ipinfo\ipinfo\Details needs to implement __isset to properly work here. #83

Open
@Simbiat

Description

I am using PHPStorm+EA Inspections and when I am accessing any of Details dynamic properties, I get errors like

[EA] \ipinfo\ipinfo\Details needs to implement __isset to properly work here.

when doing something like

if (empty($ipinfo->country_name)) {}

I found this explanation of the inspection. So essentially the issue is that there are no magic __get, __set and __isset (and probably __unset() for good measure). While this is not necessarily an issue, since empty() is going to work normally, it may be a good idea to adjust the code so that inspections would not complain like this. I mean, empty() or isset() feel pretty reasonable operators here.
Alternative is to add all possible attributes as, well, actual attributes in the class, but I do understand that since this is API parser, it may make sense to make the attributes dynamic, so that you do not need to update things in PHP code every time the output of the API changes. On the other hand, it may help with some sanitization, in case something does go wrong with the API output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /