1) Setting up CodeSniffer
Type in terminal
pear install PHP_CodeSniffer
2) Adding the CodeSniffer to Netbeans
Download the netbeans module here
3) Add the Downloaded file as a new plugin
Tools -> Plugins . see the screenshot below
Then go to Downloaded tab and click the Add Plugins..
Now click Tools -> Options and go to php tab , CodeSniffer tab and select the coding standard you want