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
The Coding Standard Tutorial page, among other things, teaches sniff developers how to create a sniff. I would like to suggest that we expand this section of the page to show how to create a sniff that can fix the violations automatically.
IMO, the sniff used as an example on that page, DisallowHashCommentsSniff.php, could be expanded to include the fixer code. I would also suggest a separate section detailing the main methods to use when creating a fixer.
If this is approved, I can work on this change to the documentation, but only in a few weeks from now. I don't mind if someone else claims this issue. I will make sure to leave a comment here when I start working on it.
The text was updated successfully, but these errors were encountered:
Text for this can be posted in a comment here (as the wiki is not publicly editable) and added to the wiki by an editor once reviewed and approved.
I would also suggest a separate section detailing the main methods to use when creating a fixer.
Regarding the methods available: when I first started working with the fixer, I used the phpDoc generated docs published on the PEAR website as a reference: https://pear.php.net/package/PHP_CodeSniffer/docs/3.5.2/apidoc/PHP_CodeSniffer/Fixer.html
Those haven't been updated for a while (and the generation for the last dozen versions released via PEAR was broken already), but not that much has changed in the Fixer class, so the info there should still be a good basis for the method reference.
Mind: while the methods are all public, some of them probably shouldn't have been and are intended only for internal use, so I don't think all methods need to be documented, only the typical public API.
The Coding Standard Tutorial page, among other things, teaches sniff developers how to create a sniff. I would like to suggest that we expand this section of the page to show how to create a sniff that can fix the violations automatically.
IMO, the sniff used as an example on that page, DisallowHashCommentsSniff.php, could be expanded to include the fixer code. I would also suggest a separate section detailing the main methods to use when creating a fixer.
If this is approved, I can work on this change to the documentation, but only in a few weeks from now. I don't mind if someone else claims this issue. I will make sure to leave a comment here when I start working on it.
The text was updated successfully, but these errors were encountered: