-
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forbidden usage of extract #48
Conversation
lib/Doctrine/ruleset.xml
Outdated
@@ -47,6 +47,7 @@ | |||
close => closedir, | |||
delete => unset, | |||
doubleval => floatval, | |||
extract => list, |
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 should not suggest a replacement here, list is not a function (also we use [...]
instead of list(...)
) so replacement suggestion is not correct imho.
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.
Indeed, as https://php.net/list says:
Like array(), this is not really a function, but a language construct. list() is used to assign a list of variables in one operation.
Thanks, gonna remove it 馃憤
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.
Looking good! Can we also ban compact()
(separate PR)?
I'd like to propose the forbidden usage of the
extract
function.list
should be used instead.Some reasons are:
array
's indexes, just some of themWhen #39 gets merged, and this one gets approved,
list
will turn into[]
馃憤