-
-
Notifications
You must be signed in to change notification settings - Fork 521
DB/DirectDatabaseQuery: add tests for namespaced names #2619
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
base: develop
Are you sure you want to change the base?
DB/DirectDatabaseQuery: add tests for namespaced names #2619
Conversation
|
Hmm... so as per #2615:
... we are ignoring method calls if they mirror the WP native functions, but now this PR will start flagging namespaced function calls which mirror the WP native functions ? That sounds very inconsistent to me. |
|
That is a good point. I'm unsure what is the best approach here. I checked other WPCS sniffs to see if they have similar behavior, and those I examined behave differently. Similar to the list of cache functions used by Do you see a reason to keep the |
|
The |
|
Thanks for your input, @jrfnl. I have pushed a new commit reverting the changes to the sniff code and updating the tests to safeguard against regressions for the current behavior of the sniff. Is this more or less what you had in mind? Do you prefer that I update the title and description of this PR to reflect that now it only adds |
990b1c9 to
282727a
Compare
@jrfnl, I ended up force pushing a new commit to this PR with just the tests safeguarding the current behavior and updated the PR title and description. It is now ready for review. (let me know if you prefer the other approach that I suggested - close this PR and create a new one - and I will do it) |
Description
In preparation for PHPCS 4.0, which changes the tokenization of namespaced names, this PR adds tests with all forms of namespaced function calls (partially qualified, fully qualified, and namespace-relative using the 'namespace' keyword) as well as fully qualified global function calls to the
WordPress.DB.DirectDatabaseQuery.Suggested changelog entry
N/A