Skip to content
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

Check function calls as well #13

Open
rskuipers opened this issue Aug 23, 2015 · 3 comments
Open

Check function calls as well #13

rskuipers opened this issue Aug 23, 2015 · 3 comments

Comments

@rskuipers
Copy link
Owner

Right now phpa doesn't take function calls into account.

For example:

if (!is_null($var)) {

The above isn't detected while it's the same as:

if ($var !== null) {

Same goes for other (userland) function calls

@rskuipers
Copy link
Owner Author

So this is an interesting case, take this for example:

if ($this->isNewObject()) {
    // ...
}

I would personally not want to add the whole === true to this since the is prefix makes the intention clear enough. But it is, by definition, still an assumption that isNewObject() returns true or false.

There are some options:

  1. Should we be strict and call this out?
  2. Should we ignore out these boolean function checks?
  3. Should we check for is or has prefixed in the function name?

@dennisdegreef
Copy link
Contributor

I would say this is a matter of taste and standards and might differ from user to user.
Not everyone uses the convention of is and has, and even if they do, they might still want strict checking, since indeed, it still is an assumption.

WARNING: Feature creep alert
Would it be an idea to be able to configure your preferences?

@rskuipers
Copy link
Owner Author

@dennisdegreef I guess introducing the concept of "rules" would not be such a bad idea :)
Good thinking Dennis, will give it some more thought :)

@rskuipers rskuipers added enhancement and removed bug labels Aug 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants