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
Add 'ignore-namespaces' option to DevelopmentCodeFragment #571
Conversation
This looks promising, can you rebase or merge in the new code to see if the tests pass? |
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.
OK for me to be merged. Still it can be improved as with PHP 7.1, such functions calls should not be considered as namespaced functions.
…v-frag-ns-ignore # Conflicts: # composer.lock
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.
Resolved conflict with master.
@tariq86 Thanks for the merge request. |
Fixes #532
What: Add new
ignore-namespaces
property toDevelopmentCodeFragment
rule, from the Design ruleset.How: Declare new property
ignore-namespaces
with a default value offalse
to avoid behavior changes. If it is enabled, then the namespace will be stripped from the function beforeWhy: As noted in #532, the current implementation is not detecting unwanted functions in namespaced classes. This is happening because
$node->findChildrenOfType('FunctionPostfix')
is returning the method names prefixed with the namespace. In other words,var_dump()
is being returned as\App\Namespace::var_dump()
). This is causing thein_array
check for dev. functions to fail.