简体   繁体   中英

How to run specifics sniffs with PHP Code Sniffer

I got PHP Code Sniffer 2.6.0. I'm using phpcs and it's working fine. I have a huge project in PHP 5.2.17, more than 2000 classes, and it will migrate to 5.6.20. I want to focus on refactoring classes with deprecated PHP functions first. I'm tried to run only Generic.PHP.DeprecatedFunctions and Squiz.PHP.ForbiddenFunctions sniffs without luck. Used the command:

phpcs --standard=Squiz --sniffs=Squiz.PHP.ForbiddenFunctions /path/to/class

I got the error:

ERROR: option "--sniffis=Squiz.PHP.ForbiddenFunctions" not known.

What I'm missing?

Sorry for my bad english.

Found the problem. phpcs just found the class if the current path is phpcs root.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM