squizlabs / PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
BSD 3-Clause "New" or "Revised" License
10.66k stars 1.48k forks source link

Where is Security::getRequestData() defined? #3847

Closed srguglielmo closed 1 year ago

srguglielmo commented 1 year ago

In the MySource.PHP.GetRequestData sniff, it references using Security::getRequestData() instead of using $_POST/$_GET/etc directly.

https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php

Where is the Security class defined...? How do I use this getRequestData() method? I've searched around on Google and it does not seem to be a public/standard library for PHP.

jrfnl commented 1 year ago

The MySource standard is a bit of an odd one out in that it appears to be a standard for a specific code base and shouldn't really be part of PHP_CodeSniffer.

The standard will be removed in PHPCS 4.0 in its entirety. See #2471

Where is the Security class defined...? How do I use this getRequestData() method? I've searched around on Google and it does not seem to be a public/standard library for PHP.

Good question, probably in the codebase for which the MySource standard was written long ago, but where is now and whether it still exists is a mystery ;-)

srguglielmo commented 1 year ago

Got it. Thanks!