Install PHP sniffer
Install the the PHP sniffer library using PRS-0 installation tool from the command line. Make sure that you have the root privileges (sudo) to install the new package
~$ sudo pear install PHP_CodeSniffer
Testing PHP sniffer
Then navigate to the directory that you want to test the class against. I have created a class with a lot of errors so that they show when we do a test.
~$ phpcs HumanClass.php
These are the results that I got from the phpcs command. I have also added two files, one that has the errors and one that passed all the tests so you can use the classes to trial the command.