You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wow, I somehow never knew about get_defined_vars() before. Thanks for brining this up!
So you're suggesting that if get_defined_vars() is called in a scope, it should disable all unused variable warnings within that scope. That does make sense in the sense that all variables in that scope are being read just by calling that function.
🤔 I'm trying to think of any risks with doing that. Do you have any real-world examples of that function being used that I could reference?
The placement of the error is a bit odd in that reference, but that's a common issue with phpcs.
* file inclusions from an object method will also pass $this, and make the object accessible in even the private scope, but that's a story for another issue.
Code speaks a thousand words.
The text was updated successfully, but these errors were encountered: