-
Notifications
You must be signed in to change notification settings - Fork 56
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
ForbiddenFunctions: Add more basic blackisted aliases #23
Conversation
is_null => null, | ||
is_real => is_float, | ||
is_writeable => is_writable, | ||
join => implode, |
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.
No clue why but I was always using join
:D
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.
This will help you cure it :P
is_double => is_float, | ||
is_integer => is_int, | ||
is_long => is_int, | ||
is_null => null, |
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.
Is this right?
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 suppose it just forbids using is_null
without suggesting an alternative function since you should be using === null
.
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.
Yes, if null
is provided, then the function is forbidden without alias being suggested, i.e.:
11 | ERROR | The use of function chop() is forbidden; use rtrim() instead
12 | ERROR | The use of function sizeof() is forbidden; use count() instead
13 | ERROR | The use of function is_null() is forbidden
c5f8e7c
to
71dbcdc
Compare
71dbcdc
to
763783c
Compare
Based on http://php.net/manual/en/aliases.php#aliases (thanks @carusogabriel for the link + squizlabs/PHP_CodeSniffer#1838)
Currently contains only Base syntax aliases.
Not auto-fixable. :/