bueltge / multisite-global-media

Share a media library across the WordPress Multisite network
GNU General Public License v2.0
213 stars 49 forks source link

Do not use phpcs:disable without a phpcs:enable and the rule name #35

Closed widoz closed 5 years ago

widoz commented 6 years ago

When you use the phpcs:disable all of the following code will not be checked for phpcs issues, that means for the rest of the file unless you call phpcs:enable the code will not checked for coding standard violations.

I suggest to use phpcs:ignore Sniff_Name if you want to ignore a single line of code and use phpcs:disable Sniff_Name when you want to ignore more line of code but call phpcs:enable after the code you want to ignore.

Adding the sniff name allow us to know which kind of violation we want to ignore. See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-parts-of-a-file for more info and examples.

bueltge commented 6 years ago

Thanks a lot for this hint, is really new for me! Thanks also for the fix via #36

widoz commented 5 years ago

Going to close this since it was merged