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
$_REQUEST should never be used because it is hard to track where the data is coming from (was it POST, or GET, or a cookie?), which makes reviewing the code more difficult. Additionally, it makes it easy to introduce sneaky and hard to find bugs, as any of the aforementioned locations can supply the data, which is hard to predict. Much better to be explicit and use either $_POST or $_GET instead.
The text was updated successfully, but these errors were encountered:
@gsherwood Just to confirm, since this is the first issue I'm trying to tackle on this project:
Since the issue seems general, the new sniff should be located under the src/Standards/Generic directory right?
And since something similar already exists, which however is pretty old,(src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php) is it ok if I re-use some of its functionality?
Since the issue seems general, the new sniff should be located under the src/Standards/Generic directory right?
Yes. That would be the right place to put it.
And since something similar already exists, which however is pretty old,(src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php) is it ok if I re-use some of its functionality?
Yes. That would be a good idea. That whole MySource standard will be removed in version 4, so if there is anything worth keeping in that sniff, please feel free to use it.
Morerice
added a commit
to Morerice/PHP_CodeSniffer
that referenced
this issue
Dec 8, 2019
Like in VIP, but this makes sense generally:
https://vip.wordpress.com/documentation/vip-go/code-review-blockers-warnings-notices/#using-_request
The text was updated successfully, but these errors were encountered: